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 install on packaged code #269

Merged
merged 2 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 3 additions & 8 deletions pulsar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ATOM_ADD=false
ATOM_NEW_WINDOW=false
EXIT_CODE_OVERRIDE=

while getopts ":anwtfvh-:" opt; do
while getopts ":anwtfvhp-:" opt; do
case "$opt" in
-)
case "${OPTARG}" in
Expand All @@ -30,10 +30,9 @@ while getopts ":anwtfvh-:" opt; do
WAIT=1
;;
help|version)
REDIRECT_STDERR=1
EXPECT_OUTPUT=1
;;
foreground|benchmark|benchmark-test|test)
foreground|benchmark|benchmark-test|test|package)
EXPECT_OUTPUT=1
;;
enable-electron-logging)
Expand All @@ -50,11 +49,7 @@ while getopts ":anwtfvh-:" opt; do
w)
WAIT=1
;;
h|v)
REDIRECT_STDERR=1
EXPECT_OUTPUT=1
;;
f|t)
f|t|h|v|p)
EXPECT_OUTPUT=1
;;
esac
Expand Down
7 changes: 6 additions & 1 deletion src/main-process/parse-command-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ module.exports = function parseCommandLine(processArgs) {
const PackageManager = require('../package-manager');
const cp = require('child_process');
const ppmPath = PackageManager.possibleApmPaths();
const ppmArgs = args['_'];

let ppmArgs = [...processArgs]
while(true) {
const arg = ppmArgs.shift()
if(arg === '-p' || arg === '--package' || ppmArgs.length === 0) break;
}
const exitCode = cp.spawnSync(ppmPath, ppmArgs, {stdio: 'inherit'}).status;
process.exit(exitCode);
return;
Expand Down