-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
37 additions
and
26 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
/** | ||
* Returns the current package manager | ||
*/ | ||
export declare function getManager(command: string): 'npm' | 'yarn' | 'pnpm' | 'bun'; | ||
/** | ||
* Checks whether the command is other than npm command | ||
*/ | ||
export declare function isOtherManagerCommand(command: string): boolean; |
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,21 @@ | ||
/** | ||
* Returns the current package manager | ||
*/ | ||
export function getManager(command: string): 'npm' | 'yarn' | 'pnpm' | 'bun' { | ||
if (command.startsWith('yarn')) { | ||
return 'yarn' | ||
} else if (command.startsWith('pnpm')) { | ||
return 'pnpm' | ||
} else if (command.startsWith('bun')) { | ||
return 'bun' | ||
} | ||
return 'npm' | ||
} | ||
|
||
/** | ||
* Checks whether the command is other than npm command | ||
*/ | ||
export function isOtherManagerCommand(command: string): boolean { | ||
const currentManager = getManager(command) | ||
return currentManager !== 'npm' | ||
} |
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