generated from actions/typescript-action
-
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.
Signed-off-by: Sam Gammon <[email protected]>
- Loading branch information
Showing
10 changed files
with
1,323 additions
and
39 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
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
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,36 @@ | ||
import * as core from '@actions/core' | ||
import * as exec from '@actions/exec' | ||
|
||
async function execBuildless(bin: string, args?: string[]): Promise<void> { | ||
core.debug(`Executing: bin=${bin}, args=${args}`) | ||
await exec.exec(`"${bin}"`, args) | ||
} | ||
|
||
/** | ||
* Enumerates available commands which can be run with the Buildless CLI tool. | ||
*/ | ||
export enum BuildlessCommand { | ||
// Print version and exit. | ||
VERSION = '--version' | ||
} | ||
|
||
/** | ||
* Enumerates well-known arguments that can be passed to the Buildless CLI tool. | ||
*/ | ||
export enum BuildlessArgument { | ||
DEBUG = '--debug=true', | ||
VERBOSE = '--verbose=true' | ||
} | ||
|
||
/** | ||
* Interrogate the specified binary to obtain the version. | ||
* | ||
* @param bin Path to the Buildless CLI tools binary. | ||
* @return Promise which resolves to the obtained version. | ||
*/ | ||
export async function obtainVersion(bin: string): Promise<string> { | ||
core.debug(`Obtaining version of Buildless binary at: ${bin}`) | ||
return (await exec.getExecOutput(`"${bin}"`, [BuildlessCommand.VERSION])).stdout | ||
.trim() | ||
.replaceAll('%0A', '') | ||
} |
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.