Skip to content

Commit

Permalink
fix: create launcher command
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jun 10, 2024
1 parent 57aeebb commit 0e1245b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe.each([
]);

expect(mockedExec.exec).toHaveBeenCalledWith('echo', [
expect.stringMatching(/.+cli-name(.exe)? .+launcher .+[$@].+/),
expect.stringMatching(/^'.+cli-name(.exe)? .+launcher .+[$@].+'$/),
'>',
expect.stringContaining(launcherName),
]);
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ export async function run() {
const launcherPath = getLauncherPath(binaryDirectory, launcherName);
await exec('touch', [launcherPath]);
await exec('echo', [
`${binaryPath} ${launcherDirectory} "$@"`,
`'${binaryPath} ${launcherDirectory} "$@"'`,
'>',
launcherPath,
]);
await exec('chmod', ['+x', launcherPath]);

// eslint-disable-next-line no-console
console.log(await exec('cat', [launcherPath]));

// Expose the SDK by adding it to the PATH
addPath(binaryDirectory);

Expand Down

0 comments on commit 0e1245b

Please sign in to comment.