From ef066a8888658beae54424137b6c12be0dc433bb Mon Sep 17 00:00:00 2001 From: Diogo Mendes Matsubara Date: Thu, 17 Oct 2024 08:05:48 +0200 Subject: [PATCH] fix: load toml-cli only once --- __tests__/cargo.test.ts | 4 +--- dist/build-crates-debian-main.js | 11 ++++++----- dist/build-crates-standalone-main.js | 11 ++++++----- dist/bump-crates-main.js | 27 ++++++++++++++------------- dist/publish-crates-cargo-main.js | 19 ++++++++++--------- dist/publish-crates-debian-main.js | 7 ++++--- dist/publish-crates-eclipse-main.js | 7 ++++--- dist/publish-crates-github-main.js | 7 ++++--- dist/publish-crates-homebrew-main.js | 10 ++++------ src/cargo.ts | 4 +--- src/toml.ts | 2 ++ 11 files changed, 56 insertions(+), 53 deletions(-) diff --git a/__tests__/cargo.test.ts b/__tests__/cargo.test.ts index ac97fae..14bf03f 100644 --- a/__tests__/cargo.test.ts +++ b/__tests__/cargo.test.ts @@ -9,9 +9,7 @@ import * as https from "https"; import { sh } from "../src/command"; import * as cargo from "../src/cargo"; -import { TOML } from "../src/toml"; - -const toml = await TOML.init(); +import { toml } from "../src/toml"; const SHA_ZENOH: string = "9ecc9031ac34f6ae0f8e5b996999277b02b3038e"; const SHA_ZENOH_KOTLIN: string = "6ba9cf6e058c959614bd7f1f4148e8fa39ef1681"; diff --git a/dist/build-crates-debian-main.js b/dist/build-crates-debian-main.js index dd87c08..2a43432 100644 --- a/dist/build-crates-debian-main.js +++ b/dist/build-crates-debian-main.js @@ -127283,7 +127283,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -127461,7 +127460,7 @@ async function configRegistry(path, name, index) { function packagesDebian(path) { const result = []; for (const package_ of packages(path)) { - const manifestRaw = toml.get(package_.manifestPath); + const manifestRaw = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get(package_.manifestPath); const manifest = ("workspace" in manifestRaw ? manifestRaw["workspace"] : manifestRaw); if ("metadata" in manifest.package && "deb" in manifest.package.metadata) { result.push(package_); @@ -127508,7 +127507,7 @@ function hostTarget() { } function buildDebian(path, target, version) { for (const package_ of packagesDebian(path)) { - const manifest = toml.get(package_.manifestPath); + const manifest = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get(package_.manifestPath); if ("variants" in manifest.package.metadata.deb) { for (const variant in manifest.package.metadata.deb.variants) { (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo deb --no-build --no-strip \ @@ -127555,7 +127554,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -127683,6 +127682,7 @@ const gitEnv = { "use strict"; __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { +/* harmony export */ "V": () => (/* binding */ toml), /* harmony export */ "f": () => (/* binding */ TOML) /* harmony export */ }); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(73292); @@ -127712,9 +127712,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/build-crates-standalone-main.js b/dist/build-crates-standalone-main.js index ce5a67c..1f6cdb7 100644 --- a/dist/build-crates-standalone-main.js +++ b/dist/build-crates-standalone-main.js @@ -127267,7 +127267,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -127481,7 +127480,7 @@ async function installBinaryCached(name) { } } function build(path, target) { - const crossManifest = toml.get((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(path, "Cross.toml")); + const crossManifest = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(path, "Cross.toml")); (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`rustup target add ${target}`, { cwd: path }); const command = target in crossManifest.target ? ["cross"] : ["cargo"]; command.push("build", "--release", "--bins", "--lib", "--target", target); @@ -127539,7 +127538,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -127696,8 +127695,9 @@ function describe(path = process.cwd()) { "use strict"; __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { -/* harmony export */ "f": () => (/* binding */ TOML) +/* harmony export */ "V": () => (/* binding */ toml) /* harmony export */ }); +/* unused harmony export TOML */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(73292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(28121); @@ -127725,9 +127725,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/bump-crates-main.js b/dist/bump-crates-main.js index 118c532..9fca02d 100644 --- a/dist/bump-crates-main.js +++ b/dist/bump-crates-main.js @@ -80989,7 +80989,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -81049,12 +81048,12 @@ function* packagesOrdered(path) { async function bump(path, version) { _actions_core__WEBPACK_IMPORTED_MODULE_2__.startGroup(`Bumping package versions in ${path} to ${version}`); const manifestPath = `${path}/Cargo.toml`; - const manifestRaw = toml.get(manifestPath); + const manifestRaw = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get(manifestPath); if ("workspace" in manifestRaw) { - await toml.set(manifestPath, ["workspace", "package", "version"], version); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.set */ .V.set(manifestPath, ["workspace", "package", "version"], version); } else { - await toml.set(manifestPath, ["package", "version"], version); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.set */ .V.set(manifestPath, ["package", "version"], version); } _actions_core__WEBPACK_IMPORTED_MODULE_2__.endGroup(); } @@ -81078,7 +81077,7 @@ async function bump(path, version) { async function bumpDependencies(path, pattern, version, _branch) { _actions_core__WEBPACK_IMPORTED_MODULE_2__.startGroup(`Bumping ${pattern} dependencies in ${path} to ${version}`); const manifestPath = `${path}/Cargo.toml`; - const manifestRaw = toml.get(manifestPath); + const manifestRaw = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get(manifestPath); let manifest; let prefix; if ("workspace" in manifestRaw) { @@ -81091,7 +81090,7 @@ async function bumpDependencies(path, pattern, version, _branch) { } for (const dep in manifest.dependencies) { if (pattern.test(dep)) { - await toml.set(manifestPath, prefix.concat("dependencies", dep, "version"), version); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.set */ .V.set(manifestPath, prefix.concat("dependencies", dep, "version"), version); // FIXME(fuzzypixelz): Previously, we set the branch of the git source in dependencies, // but as all dependencies are assumed to be on crates.io anyway, this is not necessary. // Still, the API of all related actions/workflows should be updated to reflect this. @@ -81099,12 +81098,12 @@ async function bumpDependencies(path, pattern, version, _branch) { // if (branch != undefined) { // await toml.set(manifestPath, prefix.concat("dependencies", dep, "branch"), branch); // } - await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git")); - await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch")); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.unset */ .V.unset(manifestPath, prefix.concat("dependencies", dep, "git")); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.unset */ .V.unset(manifestPath, prefix.concat("dependencies", dep, "branch")); } } for (const package_ of packages(path)) { - const manifest = toml.get(package_.manifestPath); + const manifest = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get(package_.manifestPath); if ("metadata" in manifest.package && "deb" in manifest.package.metadata && "depends" in manifest.package.metadata.deb && @@ -81113,7 +81112,7 @@ async function bumpDependencies(path, pattern, version, _branch) { const deb = manifest.package.metadata.deb; const depends = deb.depends.replaceAll(/\(=[^\(\)]+\)/g, `(=${_cargo__WEBPACK_IMPORTED_MODULE_7__/* .toDebianVersion */ .$l(version)})`); _actions_core__WEBPACK_IMPORTED_MODULE_2__.info(`Changing ${deb.depends} to ${depends} in ${package_.name}`); - await toml.set(package_.manifestPath, ["package", "metadata", "deb", "depends"], depends); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.set */ .V.set(package_.manifestPath, ["package", "metadata", "deb", "depends"], depends); } } _actions_core__WEBPACK_IMPORTED_MODULE_2__.endGroup(); @@ -81261,7 +81260,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -81388,8 +81387,9 @@ const gitEnv = { "use strict"; __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { -/* harmony export */ "f": () => (/* binding */ TOML) +/* harmony export */ "V": () => (/* binding */ toml) /* harmony export */ }); +/* unused harmony export TOML */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(3292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(8121); @@ -81417,9 +81417,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/publish-crates-cargo-main.js b/dist/publish-crates-cargo-main.js index 5d05b79..f20e6f3 100644 --- a/dist/publish-crates-cargo-main.js +++ b/dist/publish-crates-cargo-main.js @@ -80878,7 +80878,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -81018,7 +81017,7 @@ async function bumpDependencies(path, pattern, version, _branch) { async function setRegistry(path, pattern, registry) { _actions_core__WEBPACK_IMPORTED_MODULE_2__.startGroup(`Changing ${pattern} dependencies' registry ${registry}`); const manifestPath = `${path}/Cargo.toml`; - const manifestRaw = toml.get(manifestPath); + const manifestRaw = _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.get */ .V.get(manifestPath); let manifest; let prefix; if ("workspace" in manifestRaw) { @@ -81031,10 +81030,10 @@ async function setRegistry(path, pattern, registry) { } for (const dep in manifest.dependencies) { if (pattern.test(dep)) { - await toml.set(manifestPath, prefix.concat("dependencies", dep, "registry"), registry); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.set */ .V.set(manifestPath, prefix.concat("dependencies", dep, "registry"), registry); // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous - await toml.unset(manifestPath, prefix.concat("dependencies", dep, "git")); - await toml.unset(manifestPath, prefix.concat("dependencies", dep, "branch")); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.unset */ .V.unset(manifestPath, prefix.concat("dependencies", dep, "git")); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.unset */ .V.unset(manifestPath, prefix.concat("dependencies", dep, "branch")); } } _actions_core__WEBPACK_IMPORTED_MODULE_2__.endGroup(); @@ -81047,7 +81046,7 @@ async function setRegistry(path, pattern, registry) { */ async function configRegistry(path, name, index) { const configPath = `${path}/.cargo/config.toml`; - await toml.set(configPath, ["registries", name, "index"], index); + await _toml__WEBPACK_IMPORTED_MODULE_4__/* .toml.set */ .V.set(configPath, ["registries", name, "index"], index); } /** * Returns a list of all workspace packages which contain Debian package metadata. @@ -81150,7 +81149,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -81498,8 +81497,9 @@ __webpack_async_result__(); "use strict"; __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { -/* harmony export */ "f": () => (/* binding */ TOML) +/* harmony export */ "V": () => (/* binding */ toml) /* harmony export */ }); +/* unused harmony export TOML */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(3292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(8121); @@ -81527,9 +81527,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/publish-crates-debian-main.js b/dist/publish-crates-debian-main.js index 0f3a70d..2c908ed 100644 --- a/dist/publish-crates-debian-main.js +++ b/dist/publish-crates-debian-main.js @@ -127262,7 +127262,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -127534,7 +127533,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -127838,6 +127837,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { /* harmony export */ "f": () => (/* binding */ TOML) /* harmony export */ }); +/* unused harmony export toml */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(73292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(28121); @@ -127865,9 +127865,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/publish-crates-eclipse-main.js b/dist/publish-crates-eclipse-main.js index 9f5fdf2..035da8d 100644 --- a/dist/publish-crates-eclipse-main.js +++ b/dist/publish-crates-eclipse-main.js @@ -127343,7 +127343,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -127615,7 +127614,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -127944,6 +127943,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { /* harmony export */ "f": () => (/* binding */ TOML) /* harmony export */ }); +/* unused harmony export toml */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(73292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(28121); @@ -127971,9 +127971,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/publish-crates-github-main.js b/dist/publish-crates-github-main.js index 5b10d96..de51c00 100644 --- a/dist/publish-crates-github-main.js +++ b/dist/publish-crates-github-main.js @@ -127343,7 +127343,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -127615,7 +127614,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -127884,6 +127883,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { /* harmony export */ "f": () => (/* binding */ TOML) /* harmony export */ }); +/* unused harmony export toml */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(73292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(28121); @@ -127911,9 +127911,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/dist/publish-crates-homebrew-main.js b/dist/publish-crates-homebrew-main.js index f8c686f..f969ba4 100644 --- a/dist/publish-crates-homebrew-main.js +++ b/dist/publish-crates-homebrew-main.js @@ -127247,7 +127247,6 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_tom -const toml = await _toml__WEBPACK_IMPORTED_MODULE_4__/* .TOML.init */ .f.init(); /** * Uses the cargo-metadata command to list all packages in a Cargo workspace or crate. * @param path Path to the Cargo workspace or crate. @@ -127519,7 +127518,7 @@ function isPublished(pkg) { } __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), @@ -127871,9 +127870,7 @@ async function withIdentity(privateKey, passphrase, fn) { "use strict"; __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { -/* harmony export */ __nccwpck_require__.d(__webpack_exports__, { -/* harmony export */ "f": () => (/* binding */ TOML) -/* harmony export */ }); +/* unused harmony exports TOML, toml */ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(73292); /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(28121); @@ -127901,9 +127898,10 @@ class TOML { await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(path, (0,_command__WEBPACK_IMPORTED_MODULE_1__/* .exec */ .G)("toml", ["unset", path, query])); } } +const toml = await TOML.init(); __webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }); +} catch(e) { __webpack_async_result__(e); } }, 1); /***/ }), diff --git a/src/cargo.ts b/src/cargo.ts index 53aa4ae..fa6060c 100644 --- a/src/cargo.ts +++ b/src/cargo.ts @@ -4,13 +4,11 @@ import { join } from "path"; import * as core from "@actions/core"; import * as cache from "@actions/cache"; -import { TOML } from "./toml"; +import { toml } from "./toml"; import { sh } from "./command"; import { config } from "./config"; import * as cargo from "./cargo"; -const toml = await TOML.init(); - export type Package = { name: string; version: string; diff --git a/src/toml.ts b/src/toml.ts index 7078e01..4832ba2 100644 --- a/src/toml.ts +++ b/src/toml.ts @@ -24,3 +24,5 @@ export class TOML { await fs.writeFile(path, exec("toml", ["unset", path, query])); } } + +export const toml = await TOML.init();