Skip to content

Commit

Permalink
use basename
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Oct 1, 2024
1 parent c773066 commit 16f2ab5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/example-6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ jobs:
if:
(github.event_name == 'schedule' && github.repository ==
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
name: Ex6 (${{ matrix.os }})
name:
Ex6 (${{ matrix.os }}, mamba ${{ matrix.mamba-version }}, ${{
matrix.activate-environment }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
6 changes: 4 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47062,9 +47062,11 @@ exports.updateMamba = {
}),
postInstall: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () {
const mambaBat = conda.condaExecutable(options).replace(/\\/g, "/");
if (!mambaBat.includes("condabin")) {
const condabinLocation = path.join(conda.condaBasePath(options), "condabin", `mamba${constants.IS_WINDOWS ? ".bat" : ""}`);
const parentDirName = path.basename(path.dirname(mambaBat));
if (parentDirName !== "condabin") {
const condabinLocation = path.join(conda.condaBasePath(options), "condabin", path.basename(mambaBat));
if (!fs.existsSync(condabinLocation)) {
core.info(`Copying ${mambaBat} to ${condabinLocation}...`);
fs.copyFileSync(mambaBat, condabinLocation);
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/base-tools/update-mamba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ export const updateMamba: types.IToolProvider = {
},
postInstall: async (inputs, options) => {
const mambaBat = conda.condaExecutable(options).replace(/\\/g, "/");
if (!mambaBat.includes("condabin")) {
const parentDirName = path.basename(path.dirname(mambaBat));
if (parentDirName !== "condabin") {
const condabinLocation = path.join(
conda.condaBasePath(options),
"condabin",
`mamba${constants.IS_WINDOWS ? ".bat" : ""}`,
path.basename(mambaBat),
);
if (!fs.existsSync(condabinLocation)) {
core.info(`Copying ${mambaBat} to ${condabinLocation}...`);
fs.copyFileSync(mambaBat, condabinLocation);
}
}
Expand Down

0 comments on commit 16f2ab5

Please sign in to comment.