Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: installed module can not get arguments correctly #510

Merged
merged 4 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions installer/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ async function generateExecutable(
filePath: string,
commands: string[]
): Promise<void> {
commands = commands.map((v): string => '"' + v + '"');
axetroy marked this conversation as resolved.
Show resolved Hide resolved
// On Windows if user is using Powershell .cmd extension is need to run the
// installed module.
// Generate batch script to satisfy that.
Expand Down
16 changes: 8 additions & 8 deletions installer/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ installerTest(async function installBasic(): Promise<void> {
/* eslint-disable max-len */
`% This executable is generated by Deno. Please don't modify it unless you know what it means. %
@IF EXIST "%~dp0\deno.exe" (
"%~dp0\deno.exe" run http://localhost:4500/http/file_server.ts %*
"%~dp0\deno.exe" "run" "http://localhost:4500/http/file_server.ts" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.TS;=;%
deno run http://localhost:4500/http/file_server.ts %*
"deno" "run" "http://localhost:4500/http/file_server.ts" %*
)
`
/* eslint-enable max-len */
Expand All @@ -94,10 +94,10 @@ case \`uname\` in
esac

if [ -x "$basedir/deno" ]; then
"$basedir/deno" run http://localhost:4500/http/file_server.ts "$@"
"$basedir/deno" "run" "http://localhost:4500/http/file_server.ts" "$@"
ret=$?
else
deno run http://localhost:4500/http/file_server.ts "$@"
"deno" "run" "http://localhost:4500/http/file_server.ts" "$@"
ret=$?
fi
exit $ret
Expand All @@ -122,11 +122,11 @@ installerTest(async function installWithFlags(): Promise<void> {
/* eslint-disable max-len */
`% This executable is generated by Deno. Please don't modify it unless you know what it means. %
@IF EXIST "%~dp0\deno.exe" (
"%~dp0\deno.exe" run --allow-net --allow-read http://localhost:4500/http/file_server.ts --foobar %*
"%~dp0\deno.exe" "run" "--allow-net" "--allow-read" "http://localhost:4500/http/file_server.ts" "--foobar" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.TS;=;%
deno run --allow-net --allow-read http://localhost:4500/http/file_server.ts --foobar %*
"deno" "run" "--allow-net" "--allow-read" "http://localhost:4500/http/file_server.ts" "--foobar" %*
)
`
/* eslint-enable max-len */
Expand All @@ -145,10 +145,10 @@ case \`uname\` in
esac

if [ -x "$basedir/deno" ]; then
"$basedir/deno" run --allow-net --allow-read http://localhost:4500/http/file_server.ts --foobar "$@"
"$basedir/deno" "run" "--allow-net" "--allow-read" "http://localhost:4500/http/file_server.ts" "--foobar" "$@"
ret=$?
else
deno run --allow-net --allow-read http://localhost:4500/http/file_server.ts --foobar "$@"
"deno" "run" "--allow-net" "--allow-read" "http://localhost:4500/http/file_server.ts" "--foobar" "$@"
ret=$?
fi
exit $ret
Expand Down