run() { echo.message( `Restoring npm packages (via ${this.cmd()}) in ${shell.pwd()}...` ); shell.exec(this.cmd(), { silent: false }); echo.success("npm packages restored"); }
run() { echo.message( `Recursively deleting '${NODE_MODULES_DIR}' directory in ${shell.pwd()}...` ); shell.rm("-rf", NODE_MODULES_DIR); echo.success(`'${NODE_MODULES_DIR}' directory deleted successfully!`); }
/** * Retrieves the dotnet solution's release directory path */ releaseDir() { const solutionDir = this.solutionDir(); if (solutionDir == null) { return undefined; } return upath.toUnix( path.join( shell.pwd().toString(), solutionDir, this.RELEASE_DIRECTORY ) ); }
HOME: shell.pwd().toString(), NODE_ENV: "test",
shell.pwd(), dotnetPath.webProjectFileDir() );
packageApp () { switch (this.platformId) { case utilities.IOS: { return Q.Promise((resolve, reject) => { const zipCommand = 'zip -r ' + this.getPackageName() + ' ' + this.getBinaryName(); shell.pushd(this.getPackageFolder()); shell.rm('-rf', this.getPackageName()); console.log('Running command: ' + zipCommand + ' in dir: ' + shell.pwd()); exec(zipCommand, (code) => { shell.popd(); if (code) { reject('zip command returned with error code ' + code); } else { resolve(); } }); }); } case utilities.ANDROID: break; // don't need to zip the app for Android case utilities.BROWSER: break; // don't need to bundle the app on Browser platform at all default: throw new Error('Don\'t know how to package the app for platform: ' + this.platformId); } return Q.resolve(); }
/** * Creates and enters a temporary working directory. Returns the directory name as well as * a cleanup function for resetting the working directory and removing created dir/files. * * @param {string} [prefix="tmp"] (Optional) Prefix for the directory name to be generated. */ createAndUseTmpDir(prefix = "") { const defaultPrefix = "tmp"; const oldPwd = shell.pwd().toString(); const tmpDir = upath.toUnix( path.join( oldPwd, `${defaultPrefix}-${prefix}-${faker.random.uuid()}` ) ); shell.mkdir("-p", tmpDir); shell.cd(tmpDir); const cleanupTmpDir = () => { shell.cd(oldPwd); shell.rm("-rf", tmpDir); }; return { cleanupTmpDir, tmpDir }; }
const expectedPath = upath.toUnix( path.join( shell.pwd().toString(), mockFilePath, dotnetPath.RELEASE_DIRECTORY
); const pathToCli = upath.toUnix( path.join(shell.pwd().toString(), "and-cli.js") ); const developerAlias = `alias and-cli-dev='${pathToCli}'`;