-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(date-time): Resolve issue parsing ISO string in
StormDateTime
…
…constructor
- Loading branch information
1 parent
89c62aa
commit c8032d6
Showing
20 changed files
with
77 additions
and
64 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
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,49 @@ | ||
/*------------------------------------------------------------------- | ||
⚡ Storm Software - Storm Stack | ||
This code was released as part of the Storm Stack project. Storm Stack | ||
is maintained by Storm Software under the Apache-2.0 License, and is | ||
free for commercial and private use. For more information, please visit | ||
our licensing page. | ||
Website: https://stormsoftware.com | ||
Repository: https://github.com/storm-software/storm-stack | ||
Documentation: https://stormsoftware.com/projects/storm-stack/docs | ||
Contact: https://stormsoftware.com/contact | ||
License: https://stormsoftware.com/projects/storm-stack/license | ||
-------------------------------------------------------------------*/ | ||
|
||
import { detect, getCommand } from "@antfu/ni"; | ||
import { CLICommandType } from "../types"; | ||
import { execute } from "./execute"; | ||
|
||
/** | ||
* Execute a CLI command | ||
* | ||
* @remarks | ||
* This function is a wrapper around the execa command to run CLI commands | ||
* | ||
* @param command - The command to execute | ||
* @param args - The arguments to pass to the command | ||
* @param cwd - The current working directory to use when executing the command | ||
* @returns The result of the command or an exception | ||
*/ | ||
export const executeCommand = async ( | ||
command: CLICommandType = CLICommandType.EXECUTE, | ||
args?: string[], | ||
cwd: string = "./" | ||
) => { | ||
const result = getCommand( | ||
(await detect({ | ||
autoInstall: true, | ||
cwd, | ||
programmatic: true | ||
})) ?? "npm", | ||
command, | ||
args | ||
); | ||
|
||
return execute(`${result.command} ${result.args.join(" ")}`, cwd); | ||
}; |
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
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
Oops, something went wrong.