cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhilkh <...@git.apache.org>
Subject [GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Date Wed, 13 Apr 2016 23:40:48 GMT
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-paramedic/pull/4#discussion_r59644686
  
    --- Diff: lib/ParamedicPermissions.js ---
    @@ -0,0 +1,60 @@
    +#!/usr/bin/env node
    +
    +/* jshint node: true */
    +var path 	 = require('path');
    +var fs 		 = require('fs');
    +var shelljs  = require("shelljs");
    +var logger  = require('./utils').logger;
    +
    +function ParamedicPermissions(appName, simulatorsFolder, dbPath) {
    +	this.appName = appName;
    +	this.simulatorsFolder = simulatorsFolder;
    +	this.dbPath = dbPath;
    +}
    +
    +ParamedicPermissions.prototype.updatePermissions = function(serviceList){
    +	var self = this;
    +	this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){
    +		var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db');
    +
    +		//Check if the simFolder has TCC.db file in it
    +		if(self.doesFileExist(destinationTCCFile)) {
    +			var sqlite3Command_firstPart  = 'sqlite3 ' + destinationTCCFile;
    +			var sqlite3Command_secondPart = ' "insert into access(service, client, client_type,
allowed, prompt_count, csreq) values(\'';
    +			var sqlite3Command_lastPart   = '\',\'' + self.appName + '\',0,1,1,NULL)"';
    +			serviceList.forEach(function(service){
    +				var command = sqlite3Command_firstPart  +  sqlite3Command_secondPart + service +
sqlite3Command_lastPart ;
    --- End diff --
    
    Consider using `util.format`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message