-
-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature:
<packagemanager> install
is now ran at the end of the migr…
…ation. Feature: Better error handling is now in place.
- Loading branch information
Showing
8 changed files
with
116 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@skeletonlabs/skeleton-cli': patch | ||
--- | ||
|
||
Feature: Better error handling is now in place. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@skeletonlabs/skeleton-cli': patch | ||
--- | ||
|
||
Feature: `<packagemanager> install` is now ran at the end of the migration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { detect, resolveCommand } from 'package-manager-detector'; | ||
import { execSync } from 'node:child_process'; | ||
|
||
async function installDependencies(cwd = process.cwd()) { | ||
const pm = await detect({ | ||
cwd: cwd | ||
}); | ||
const resolvedCommand = resolveCommand(pm?.agent ?? 'npm', 'install', ['--force']); | ||
if (!resolvedCommand) { | ||
throw new Error('Could not resolve package manager command.'); | ||
} | ||
execSync(`${resolvedCommand.command} ${resolvedCommand.args.join(' ')}`, { | ||
cwd: cwd, | ||
stdio: 'ignore' | ||
}); | ||
} | ||
|
||
export { installDependencies }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.