* Ensures go-sqlcmd is in the runner's tool cache and PATH environment variable.
()
| 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. |
no test coverage detected