Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-paramedic/pull/4#discussion_r60329456
  
    --- Diff: lib/ParamediciOSPermissions.js ---
    @@ -0,0 +1,43 @@
    +#!/usr/bin/env node
    +
    +/* jshint node: true */
    +var path     = require('path');
    +var fs       = require('fs');
    +var shelljs  = require("shelljs");
    +var logger   = require('./utils').logger;
    +var util     = require('./utils').utilities;
    +
    +var TCC_FOLDER_PERMISSION = 0777;
    +
    +function ParamediciOSPermissions(appName, tccDbPath) {
    +    this.appName = appName;
    +    this.tccDbPath = tccDbPath;
    +}
    +
    +ParamediciOSPermissions.prototype.updatePermissions = 
function(serviceList){
    +    var simulatorsFolder   = util.getSimulatorsFolder();
    +    var simId              = util.getSimId();
    +    logger.info('Sim Id is: ' + simId);
    +    var destinationTCCFile = path.join(simulatorsFolder, simId, 
'/data/Library/TCC/TCC.db');
    +
    +    if(!util.doesFileExist(destinationTCCFile)) {
    +        // No TCC.db file exists by default. So, Copy the new TCC.db file
    +        var destinationTCCFolder = path.join(simulatorsFolder, simId, 
'/data/Library/TCC');
    +        if(!util.doesFileExist(destinationTCCFolder)){
    +            fs.mkdir(destinationTCCFolder, TCC_FOLDER_PERMISSION);
    +        }
    +        var command = "cp " + this.tccDbPath + " " + destinationTCCFolder;
    +        logger.info("Running Command: " + command);
    +        shelljs.exec(command, {silent: true, async: false});
    +    }
    --- End diff --
    
    The `ncp` module is also an option.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to