Skip to content

Commit

Permalink
Fixes prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Maël Nison committed Apr 26, 2018
1 parent 8f453f6 commit 47fcdf5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions packages/pkg-tests/pkg-tests-core/sources/utils/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,15 @@ exports.readJson = async function readJson(source: string): Promise<any> {
throw new Error(`Invalid json file (${source})`);
}
};

exports.chmod = function chmod(target: string, mod: number): Promise<void> {
return fs.chmod(target, mod);
};

exports.makeFakeBinary = async function(
target: string,
{output = `Fake binary`, exitCode = 1}: {|output: string, exitCode: number|} = {},
): Promise<void> {
await exports.writeFile(target, `#!/bin/sh\necho "${output}"\nexit ${exitCode}\n`);
await exports.chmod(target, 0o755);
};
4 changes: 2 additions & 2 deletions src/util/execute-lifecycle-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ export async function makeEnv(
// split up the path
const envPath = env[constants.ENV_PATH_KEY];
const pathParts = envPath ? envPath.split(path.delimiter) : [];

// Include the directory that contains node so that we can guarantee that the scripts
// will always run with the exact same Node release than the one use to run Yarn
pathParts.unshift(path.dirname(process.execPath));

// Include node-gyp version that was bundled with the current Node.js version,
// if available.
pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
Expand Down

0 comments on commit 47fcdf5

Please sign in to comment.