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 a4c0c2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 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,11 @@ exports.readJson = async function readJson(source: string): Promise<any> {
throw new Error(`Invalid json file (${source})`);
}
};

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 a4c0c2f

Please sign in to comment.