From 85a34ff6eb400582f1d90c3bd68f93fc5f944620 Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Thu, 14 Dec 2023 14:19:38 +0100 Subject: [PATCH] Add warning for condarc files not named .condarc (#182) --- dist/index.js | 15 ++++++++++----- dist/post.js | 15 ++++++++++----- package.json | 2 +- src/options.ts | 5 +++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1319102..ba29ea4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8441,8 +8441,8 @@ var require_internal_path = __commonJS({ let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path5.basename(remaining); - this.segments.unshift(basename); + const basename2 = path5.basename(remaining); + this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); } @@ -11977,7 +11977,7 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/.pnpm/@fastify+busboy@2.0.0/node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module2) { "use strict"; - module2.exports = function basename(path5) { + module2.exports = function basename2(path5) { if (typeof path5 !== "string") { return ""; } @@ -12003,7 +12003,7 @@ var require_multipart = __commonJS({ var Dicer = require_Dicer(); var parseParams = require_parseParams(); var decodeText = require_decodeText(); - var basename = require_basename(); + var basename2 = require_basename(); var getLimit = require_getLimit(); var RE_BOUNDARY = /^boundary$/i; var RE_FIELD = /^form-data$/i; @@ -12120,7 +12120,7 @@ var require_multipart = __commonJS({ } else if (RE_FILENAME.test(parsed[i][0])) { filename = parsed[i][1]; if (!preservePath) { - filename = basename(filename); + filename = basename2(filename); } } } @@ -83525,6 +83525,11 @@ var checkForKnownIssues = (options2) => { "You are using a micromamba version < 1.4.5-0 and initialize the shell. This is behavior is deprecated. Please update the micromamba version. For further informations, see https://github.com/mamba-org/setup-micromamba/pull/107" ); } + if (options2.condarcFile && path.basename(options2.condarcFile) !== ".condarc") { + throw new Error( + `You are using a condarc file that is not named '.condarc'. This is currently not supported by micromamba, see https://github.com/mamba-org/mamba/issues/1394` + ); + } }; var getOptions = () => { const inputs = { diff --git a/dist/post.js b/dist/post.js index b83103f..4cfc8e9 100644 --- a/dist/post.js +++ b/dist/post.js @@ -6439,8 +6439,8 @@ var require_internal_path = __commonJS({ let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path5.basename(remaining); - this.segments.unshift(basename); + const basename2 = path5.basename(remaining); + this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); } @@ -10052,7 +10052,7 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/.pnpm/@fastify+busboy@2.0.0/node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module2) { "use strict"; - module2.exports = function basename(path5) { + module2.exports = function basename2(path5) { if (typeof path5 !== "string") { return ""; } @@ -10078,7 +10078,7 @@ var require_multipart = __commonJS({ var Dicer = require_Dicer(); var parseParams = require_parseParams(); var decodeText = require_decodeText(); - var basename = require_basename(); + var basename2 = require_basename(); var getLimit = require_getLimit(); var RE_BOUNDARY = /^boundary$/i; var RE_FIELD = /^form-data$/i; @@ -10195,7 +10195,7 @@ var require_multipart = __commonJS({ } else if (RE_FILENAME.test(parsed[i][0])) { filename = parsed[i][1]; if (!preservePath) { - filename = basename(filename); + filename = basename2(filename); } } } @@ -78789,6 +78789,11 @@ var checkForKnownIssues = (options2) => { "You are using a micromamba version < 1.4.5-0 and initialize the shell. This is behavior is deprecated. Please update the micromamba version. For further informations, see https://github.com/mamba-org/setup-micromamba/pull/107" ); } + if (options2.condarcFile && path.basename(options2.condarcFile) !== ".condarc") { + throw new Error( + `You are using a condarc file that is not named '.condarc'. This is currently not supported by micromamba, see https://github.com/mamba-org/mamba/issues/1394` + ); + } }; var getOptions = () => { const inputs = { diff --git a/package.json b/package.json index dc26eb7..a4c6a5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-micromamba", - "version": "1.7.0", + "version": "1.7.1", "private": true, "description": "Action to setup micromamba", "scripts": { diff --git a/src/options.ts b/src/options.ts index 1cdd7d9..5921a49 100644 --- a/src/options.ts +++ b/src/options.ts @@ -224,6 +224,11 @@ const checkForKnownIssues = (options: Options) => { 'You are using a micromamba version < 1.4.5-0 and initialize the shell. This is behavior is deprecated. Please update the micromamba version. For further informations, see https://github.com/mamba-org/setup-micromamba/pull/107' ) } + if (options.condarcFile && path.basename(options.condarcFile) !== '.condarc') { + throw new Error( + `You are using a condarc file that is not named '.condarc'. This is currently not supported by micromamba, see https://github.com/mamba-org/mamba/issues/1394` + ) + } } const getOptions = () => {