MCPcopy Create free account
hub / github.com/Azure/sql-action / setupSqlcmd

Method setupSqlcmd

src/Setup.ts:17–27  ·  view source on GitHub ↗

* Ensures go-sqlcmd is in the runner's tool cache and PATH environment variable.

()

Source from the content-addressed store, hash-verified

15 * Ensures go-sqlcmd is in the runner's tool cache and PATH environment variable.
16 */
17 public static async setupSqlcmd(): Promise<void> {
18 // Get sqlcmd from tool cache; if not found, download it and add to tool cache
19 let sqlcmdPath = tc.find(sqlcmdToolName, sqlcmdVersion);
20 if (!sqlcmdPath) {
21 const extractedPath = await this.downloadAndExtractSqlcmd();
22 sqlcmdPath = await tc.cacheDir(extractedPath, sqlcmdToolName, sqlcmdVersion);
23 }
24
25 // Add sqlcmd to PATH
26 core.addPath(sqlcmdPath);
27 }
28
29 /**
30 * Downloads go-sqlcmd release from GitHub and extracts from the compressed file.

Callers 1

runFunction · 0.45

Calls 2

findMethod · 0.80

Tested by

no test coverage detected