lib/docker.js
function getUid() {

    if (opts.deploy) {
        // get the deploy repo location
        return promisedSpawn(
            ['git', 'config', 'deploy.dir'],
            {
                capture: true,
                errMessage: 'You must set the location of the deploy repo!\n' +
                    'Use git config deploy.dir /full/path/to/deploy/dir'
            }
        ).then((dir) => {
            opts.dir = dir;
            // make sure that the dir exists and it is a git repo
            return fs.statAsync(`${dir}/.git`);
        }).then((stat) => {
            opts.uid = stat.uid;
            opts.gid = stat.gid;
        }).catch(() => {
            console.error(`ERROR: The deploy repo dir ${opts.dir} does not exist or is not a git repo!`);
            process.exit(3);
        });
    }

    // get the uid/gid from statting package.json
    return fs.statAsync('package.json')
    .then((stat) => {
        opts.uid = stat.uid;
        opts.gid = stat.gid;
    }).catch(() => {
        console.error('ERROR: package.json does not exist!');
        process.exit(4);
    });
}
function getUid() {

    if (opts.deploy) {
        // get the deploy repo location
        return promisedSpawn(
            ['git', 'config', 'deploy.dir'],
            {
                capture: true,
                errMessage: 'You must set the location of the deploy repo!\n' +
                    'Use git config deploy.dir /full/path/to/deploy/dir'
            }
        ).then((dir) => {
            opts.dir = dir;
            // make sure that the dir exists and it is a git repo
            return fs.statAsync(`${dir}/.git`);
        }).then((stat) => {
            opts.uid = stat.uid;
            opts.gid = stat.gid;
        }).catch(() => {
            console.error(`ERROR: The deploy repo dir ${opts.dir} does not exist or is not a git repo!`);
            process.exit(3);
        });
    }

    // get the uid/gid from statting package.json
    return fs.statAsync('package.json')
    .then((stat) => {
        opts.uid = stat.uid;
        opts.gid = stat.gid;
    }).catch(() => {
        console.error('ERROR: package.json does not exist!');
        process.exit(4);
    });
}
function getUid ( ) { if ( opts . deploy ) { // get the deploy repo location return promisedSpawn ( [ 'git' , 'config' , 'deploy.dir' ] , { capture : true , errMessage : 'You must set the location of the deploy repo!\n' + 'Use git config deploy.dir /full/path/to/deploy/dir' } ) . then ( ( dir ) => { opts . dir = dir ; // make sure that the dir exists and it is a git repo return fs . statAsync ( ` ${ dir } ` ) ; } ) . then ( ( stat ) => { opts . uid = stat . uid ; opts . gid = stat . gid ; } ) . catch ( ( ) => { console . error ( ` ${ opts . dir } ` ) ; process . exit ( 3 ) ; } ) ; } // get the uid/gid from statting package.json return fs . statAsync ( 'package.json' ) . then ( ( stat ) => { opts . uid = stat . uid ; opts . gid = stat . gid ; } ) . catch ( ( ) => { console . error ( 'ERROR: package.json does not exist!' ) ; process . exit ( 4 ) ; } ) ; }
Determines the UID and GID to run under in the container
@return {Promise} a promise resolving when the check is done
Determines the UID and GID to run under in the container