Skip to content

Commit c29140c

Browse files
authored
chore: fix node:util parseArgs migration (#873)
Also small aesthetic change for install script
1 parent a57ae50 commit c29140c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

scripts/install/install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ tildify() {
200200
fi
201201
}
202202

203+
echo ''
204+
echo ''
203205
success "Apify and Actor CLI $version were installed successfully!"
204206
info "The binaries are located at $Bold_Green$(tildify "$bin_dir/apify") ${Dim}and $Bold_Green$(tildify "$bin_dir/actor")"
205207

src/commands/cli-management/install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class InstallCommand extends ApifyCommand<typeof InstallCommand> {
3232
const { installMethod, installPath, version } = useCLIMetadata();
3333

3434
if (installMethod !== 'bundle') {
35-
info({ message: `Apify and Actor CLI are already fully configured! 👍 \n` });
35+
info({ message: `Apify and Actor CLI are already fully configured! 👍` });
3636
return;
3737
}
3838

@@ -41,7 +41,7 @@ export class InstallCommand extends ApifyCommand<typeof InstallCommand> {
4141
const installMarkerPath = pathToInstallMarker(installPath);
4242

4343
if (existsSync(installMarkerPath)) {
44-
info({ message: `Apify and Actor CLI are already fully configured! 👍 \n` });
44+
info({ message: `Apify and Actor CLI are already fully configured! 👍` });
4545
return;
4646
}
4747

src/entrypoints/_shared.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ export async function runCLI(entrypoint: string) {
119119

120120
const startingArgs = process.argv.slice(2);
121121

122+
cliDebugPrint('ProcessArgv', startingArgs);
123+
122124
const startingResult = parseArgs({
123125
allowPositionals: true,
124126
strict: false,
@@ -144,7 +146,7 @@ export async function runCLI(entrypoint: string) {
144146

145147
// MIDDLEWARE END //
146148

147-
cliDebugPrint('StartingArgs', startingResult);
149+
cliDebugPrint('TopLevelOptions', startingResult);
148150

149151
const [commandName, maybeSubcommandName] = startingResult.positionals;
150152
let hasSubcommand = false;
@@ -175,11 +177,13 @@ export async function runCLI(entrypoint: string) {
175177
// All this tomfoolery is to ensure that if the arguments are something like [kvs, --json, ls], it'll parse correctly
176178
const rebuiltArgs: string[] = [...startingArgs];
177179

178-
const commandNameIndex = startingArgs.indexOf(commandName);
180+
const commandNameIndex = rebuiltArgs.indexOf(commandName);
181+
cliDebugPrint('CommandNameIndex', commandNameIndex);
179182
rebuiltArgs.splice(commandNameIndex, 1);
180183

181184
if (hasSubcommand) {
182-
const subcommandNameIndex = startingArgs.indexOf(maybeSubcommandName);
185+
const subcommandNameIndex = rebuiltArgs.indexOf(maybeSubcommandName);
186+
cliDebugPrint('SubcommandNameIndex', subcommandNameIndex);
183187
rebuiltArgs.splice(subcommandNameIndex, 1);
184188
}
185189

0 commit comments

Comments
 (0)