mirror of
https://github.com/prefix-dev/setup-pixi
synced 2026-10-08 15:04:08 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84fcc9f320 | ||
|
|
292519c071 | ||
|
|
a4caa61122 | ||
|
|
f18b03747b |
+1152
-1152
File diff suppressed because it is too large
Load Diff
+3
-2
@@ -80665,17 +80665,18 @@ var getNewPathComponents = (path4) => {
|
||||
if (!currentPath) {
|
||||
throw new Error("Unable to obtain current PATH from environment");
|
||||
}
|
||||
core4.debug(`Found current path '${currentPath}'`);
|
||||
core4.debug(`Got new path '${path4}'`);
|
||||
if (!path4.endsWith(currentPath)) {
|
||||
throw new Error("Unable to handle environment activation which does not only append to PATH");
|
||||
}
|
||||
core4.debug(`Found current path '${currentPath}'`);
|
||||
core4.debug(`Got new path '${path4}'`);
|
||||
const newPath = path4.slice(0, path4.length - currentPath.length);
|
||||
return newPath.split(osPath.delimiter).filter((p) => p.length > 0);
|
||||
};
|
||||
var activateEnvironment = async (environment) => {
|
||||
const envOption = environment === "default" ? "" : `-e ${environment}`;
|
||||
const shellHookOutput = await executeGetOutput(pixiCmd(`shell-hook ${envOption} --json`), { silent: true });
|
||||
core4.debug(`Got shell hook output '${shellHookOutput.stdout}'`);
|
||||
const shellHook = JSON.parse(shellHookOutput.stdout);
|
||||
const [envVars, path4] = splitEnvironment(shellHook);
|
||||
if (path4) {
|
||||
|
||||
+3
-2
@@ -35,11 +35,11 @@ const getNewPathComponents = (path: string): string[] => {
|
||||
if (!currentPath) {
|
||||
throw new Error('Unable to obtain current PATH from environment')
|
||||
}
|
||||
core.debug(`Found current path '${currentPath}'`)
|
||||
core.debug(`Got new path '${path}'`)
|
||||
if (!path.endsWith(currentPath)) {
|
||||
throw new Error('Unable to handle environment activation which does not only append to PATH')
|
||||
}
|
||||
core.debug(`Found current path '${currentPath}'`)
|
||||
core.debug(`Got new path '${path}'`)
|
||||
const newPath = path.slice(0, path.length - currentPath.length)
|
||||
return newPath.split(osPath.delimiter).filter((p) => p.length > 0)
|
||||
}
|
||||
@@ -48,6 +48,7 @@ export const activateEnvironment = async (environment: string): Promise<void> =>
|
||||
// First, obtain the environment variables that would be set by environment activation
|
||||
const envOption = environment === 'default' ? '' : `-e ${environment}`
|
||||
const shellHookOutput = await executeGetOutput(pixiCmd(`shell-hook ${envOption} --json`), { silent: true })
|
||||
core.debug(`Got shell hook output '${shellHookOutput.stdout}'`)
|
||||
const shellHook = JSON.parse(shellHookOutput.stdout) as ShellHook
|
||||
|
||||
// Then, we split the environment variables into the special 'PATH' and all others
|
||||
|
||||
Reference in New Issue
Block a user