mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-06 05:35:46 +02:00
merge: resolve conflicts with main (v0.11.5.0 → v0.11.5.1)
VERSION and CHANGELOG conflicts resolved: our inline office-hours feature rebased on top of main's v0.11.5.0 (Bash Compatibility Fix).
This commit is contained in:
@@ -1004,6 +1004,25 @@ describe('gstack-slug', () => {
|
||||
expect(slug).toMatch(/^[a-zA-Z0-9._-]+$/);
|
||||
expect(branch).toMatch(/^[a-zA-Z0-9._-]+$/);
|
||||
});
|
||||
test('eval sets variables under bash with set -euo pipefail', () => {
|
||||
const result = Bun.spawnSync(
|
||||
['bash', '-c', 'set -euo pipefail; eval "$(./bin/gstack-slug 2>/dev/null)"; echo "SLUG=$SLUG"; echo "BRANCH=$BRANCH"'],
|
||||
{ cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }
|
||||
);
|
||||
expect(result.exitCode).toBe(0);
|
||||
const output = result.stdout.toString();
|
||||
expect(output).toMatch(/^SLUG=.+/m);
|
||||
expect(output).toMatch(/^BRANCH=.+/m);
|
||||
});
|
||||
|
||||
test('no templates or bin scripts use source process substitution for gstack-slug', () => {
|
||||
const result = Bun.spawnSync(
|
||||
['grep', '-r', 'source <(.*gstack-slug', '--include=*.tmpl', '--include=gstack-review-*', '.'],
|
||||
{ cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }
|
||||
);
|
||||
// grep returns exit code 1 when no matches found — that's what we want
|
||||
expect(result.stdout.toString().trim()).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
// --- Test Bootstrap validation ---
|
||||
|
||||
Reference in New Issue
Block a user