mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-30 03:44:38 +01:00
Windows: a python3 that won't run no longer deletes skills on update, and long test commands fail clearly (#4793)
On Windows, an update no longer deletes your brain-aware skills when `python3` is the Microsoft Store alias, and a pre-ship test command too long for Git Bash is split to fit or refused clearly instead of running cut off. Why: keeps install and upgrade working on Windows, where gstack promises minimal support (#4752 by @Barack-zero-to-one, #4773 by @targetpark). Nothing to do. Co-authored-by: Barack-zero-to-one <121355791+Barack-zero-to-one@users.noreply.github.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: bin/gstack-config:1335:completeness reader=core Review-Finding: lib/pregate/checks/lanes.ts:457:completeness reader=core Review-Finding: lib/pregate/checks/lanes.ts:442:completeness reader=core Review-Finding: lib/pregate/checks/lanes.ts:456:completeness reader=core
This commit is contained in:
10 files changed
+207
-40
No files matched your search
@@ -213,9 +213,18 @@ export function scriptInvocation(script: string, args: readonly string[], o: Inv
|
||||
return bash.ok ? { ok: true, cmd: bash.bash, argv: [slash(script), ...args] } : bash;
|
||||
}
|
||||
|
||||
/** How to run `bash -c <command>` on this platform. */
|
||||
/**
|
||||
* Characters of one argument that Git Bash keeps when a Windows program starts it: the Cygwin/MSYS runtime silently drops
|
||||
* the rest of an argument with spaces (#4773; reported on Git for Windows 2.53, bash 5.2.37).
|
||||
*/
|
||||
export const WINDOWS_BASH_ARG_MAX = 8186;
|
||||
|
||||
/** How to run `bash -c <command>` on this platform. On Windows a command Git Bash would cut off is refused, never run. */
|
||||
export function bashCommandInvocation(command: string, o: InvocationOptions = {}): Invocation {
|
||||
if ((o.platform ?? process.platform) !== 'win32') return { ok: true, cmd: 'bash', argv: ['-c', command] };
|
||||
if (command.length > WINDOWS_BASH_ARG_MAX) {
|
||||
return { ok: false, error: `argument list too long for Git Bash: the bash -c command is ${command.length.toLocaleString('en-US')} characters and Git Bash on Windows keeps only the first ${WINDOWS_BASH_ARG_MAX.toLocaleString('en-US')}, so it was not started rather than run cut off (#4773)` };
|
||||
}
|
||||
const bash = windowsBash(o);
|
||||
return bash.ok ? { ok: true, cmd: bash.bash, argv: ['-c', command] } : bash;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user