From 74d91a2500b3b76727a3088911b268713d03a992 Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Thu, 17 Oct 2024 08:36:13 +0200 Subject: [PATCH] fix: add option to not use cargo cache --- dist/build-crates-debian-main.js | 6 +++--- dist/build-crates-standalone-main.js | 6 +++--- dist/bump-crates-main.js | 6 +++--- dist/publish-crates-cargo-main.js | 6 +++--- dist/publish-crates-debian-main.js | 6 +++--- dist/publish-crates-eclipse-main.js | 6 +++--- dist/publish-crates-github-main.js | 6 +++--- dist/publish-crates-homebrew-main.js | 6 +++--- src/cargo.ts | 4 ++-- src/toml.ts | 2 +- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/dist/build-crates-debian-main.js b/dist/build-crates-debian-main.js index dd87c08..93b489c 100644 --- a/dist/build-crates-debian-main.js +++ b/dist/build-crates-debian-main.js @@ -127477,8 +127477,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -127696,7 +127696,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/build-crates-standalone-main.js b/dist/build-crates-standalone-main.js index ce5a67c..feff1e1 100644 --- a/dist/build-crates-standalone-main.js +++ b/dist/build-crates-standalone-main.js @@ -127461,8 +127461,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -127709,7 +127709,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/bump-crates-main.js b/dist/bump-crates-main.js index 118c532..79cbbc9 100644 --- a/dist/bump-crates-main.js +++ b/dist/bump-crates-main.js @@ -81183,8 +81183,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -81401,7 +81401,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/publish-crates-cargo-main.js b/dist/publish-crates-cargo-main.js index 5d05b79..d18092f 100644 --- a/dist/publish-crates-cargo-main.js +++ b/dist/publish-crates-cargo-main.js @@ -81072,8 +81072,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -81511,7 +81511,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/publish-crates-debian-main.js b/dist/publish-crates-debian-main.js index 0f3a70d..20899ad 100644 --- a/dist/publish-crates-debian-main.js +++ b/dist/publish-crates-debian-main.js @@ -127456,8 +127456,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -127849,7 +127849,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/publish-crates-eclipse-main.js b/dist/publish-crates-eclipse-main.js index 9f5fdf2..24f0ce5 100644 --- a/dist/publish-crates-eclipse-main.js +++ b/dist/publish-crates-eclipse-main.js @@ -127537,8 +127537,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -127955,7 +127955,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/publish-crates-github-main.js b/dist/publish-crates-github-main.js index 5b10d96..aabba94 100644 --- a/dist/publish-crates-github-main.js +++ b/dist/publish-crates-github-main.js @@ -127537,8 +127537,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -127895,7 +127895,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/dist/publish-crates-homebrew-main.js b/dist/publish-crates-homebrew-main.js index f8c686f..8addcca 100644 --- a/dist/publish-crates-homebrew-main.js +++ b/dist/publish-crates-homebrew-main.js @@ -127441,8 +127441,8 @@ function installBinaryFromGit(name, gitUrl, gitBranch) { * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -async function installBinaryCached(name) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +async function installBinaryCached(name, useCache) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [(0,path__WEBPACK_IMPORTED_MODULE_1__.join)(os__WEBPACK_IMPORTED_MODULE_0__.homedir(), ".cargo", "bin")]; const version = _config__WEBPACK_IMPORTED_MODULE_6__/* .config.lock.cratesio */ .v.lock.cratesio[name]; const key = `${os__WEBPACK_IMPORTED_MODULE_0__.platform()}-${os__WEBPACK_IMPORTED_MODULE_0__.release()}-${os__WEBPACK_IMPORTED_MODULE_0__.arch()}-${name}-${version}`; @@ -127885,7 +127885,7 @@ _cargo__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (aw class TOML { static async init() { - await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2"); + await _cargo__WEBPACK_IMPORTED_MODULE_2__/* .installBinaryCached */ .Mj("toml-cli2", false); return new TOML(); } get(path, key) { diff --git a/src/cargo.ts b/src/cargo.ts index 53aa4ae..65163ee 100644 --- a/src/cargo.ts +++ b/src/cargo.ts @@ -291,8 +291,8 @@ export function installBinaryFromGit(name: string, gitUrl: string, gitBranch: st * The executable is cached using GitHub's `@actions/cache`. * @param name Name of the cargo binary on crates.io */ -export async function installBinaryCached(name: string) { - if (process.env["GITHUB_ACTIONS"] != undefined) { +export async function installBinaryCached(name: string, useCache?: boolean) { + if (process.env["GITHUB_ACTIONS"] != undefined && useCache == true) { const paths = [join(os.homedir(), ".cargo", "bin")]; const version = config.lock.cratesio[name]; const key = `${os.platform()}-${os.release()}-${os.arch()}-${name}-${version}`; diff --git a/src/toml.ts b/src/toml.ts index 7078e01..79edf04 100644 --- a/src/toml.ts +++ b/src/toml.ts @@ -5,7 +5,7 @@ import * as cargo from "./cargo"; export class TOML { static async init(): Promise { - await cargo.installBinaryCached("toml-cli2"); + await cargo.installBinaryCached("toml-cli2", false); return new TOML(); }