+14
-1
@@ -66,16 +66,22 @@ exit 0
|
||||
echo "gnome-extensions $*" >> '${log}'
|
||||
if [ "$1" = install ]; then exit 1; fi
|
||||
exit 0
|
||||
`);
|
||||
await writeFile(path.join(bin, 'logger'), `#!/bin/sh
|
||||
echo "logger $*" >> '${log}'
|
||||
exit 0
|
||||
`);
|
||||
await chmod(path.join(bin, 'systemctl'), 0o755);
|
||||
await chmod(path.join(bin, 'gnome-extensions'), 0o755);
|
||||
await chmod(path.join(bin, 'logger'), 0o755);
|
||||
|
||||
await run('bash', [path.join(root, 'packaging/install.sh'), '--enable'], {
|
||||
const result = await run('bash', [path.join(root, 'packaging/install.sh'), '--enable'], {
|
||||
...process.env,
|
||||
HOME: home,
|
||||
PATH: `${bin}:${process.env.PATH}`,
|
||||
XDG_DATA_HOME: path.join(home, '.local/share'),
|
||||
XDG_CACHE_HOME: path.join(home, '.cache'),
|
||||
XDG_STATE_HOME: path.join(home, '.local/state'),
|
||||
});
|
||||
|
||||
assert.equal(existsSync(path.join(appDir, 'stale-old-version.js')), false);
|
||||
@@ -92,6 +98,13 @@ exit 0
|
||||
assert.match(commands, /systemctl --user stop jarvisd\.service/);
|
||||
assert.match(commands, /gnome-extensions uninstall jarvis@qvac\.local/);
|
||||
assert.match(commands, /systemctl --user restart jarvisd\.service/);
|
||||
const installLog = await readFile(path.join(home, '.local/state/jarvis/install.log'), 'utf8');
|
||||
assert.match(installLog, /stopping running jarvisd\.service/);
|
||||
assert.match(installLog, /removing leftover staging directory/);
|
||||
assert.match(installLog, /removing previous application tree/);
|
||||
assert.match(installLog, /kept existing .*config\.json/);
|
||||
assert.match(installLog, /install complete; log file/);
|
||||
assert.match(result.stdout, /jarvis-install: stopping running jarvisd\.service/);
|
||||
} finally {
|
||||
await rm(work, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user