Compare commits

...
4 Commits
Author SHA1 Message Date
Pavel Zwerschke 84fcc9f320 ? 2025-12-16 14:52:35 +01:00
Pavel Zwerschke 292519c071 test ubuntu-24.04-arm 2025-12-16 14:49:27 +01:00
Pavel Zwerschke a4caa61122 WIP 2025-12-16 14:00:00 +01:00
Pavel Zwerschke f18b03747b feat: Adjust debug log message for activate-environment 2025-12-16 13:58:50 +01:00
3 changed files with 1158 additions and 1156 deletions
+1152 -1152
View File
File diff suppressed because it is too large Load Diff
Generated Vendored
+3 -2
View File
@@ -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
View File
@@ -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