feat(update): consolidate update msgs and format at end
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
262bcedbd2
commit
44d56aab0f
2 changed files with 46 additions and 4 deletions
|
@ -1,8 +1,18 @@
|
|||
import { spawnSync } from 'node:child_process';
|
||||
|
||||
import { parseArgs } from './lib.ts';
|
||||
import { updateFirefoxAddons } from '././firefox.ts';
|
||||
import { updateDocker, updateFlakeInputs, updateVuetorrent } from './misc.ts';
|
||||
|
||||
|
||||
/* Constants */
|
||||
const FLAKE = process.env.FLAKE;
|
||||
|
||||
if (!FLAKE) {
|
||||
console.error('Env var FLAKE not found');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const args = parseArgs();
|
||||
|
||||
if (args['d'] || args['docker']) {
|
||||
|
@ -22,8 +32,38 @@ if (args['v'] || args['vuetorrent']) {
|
|||
}
|
||||
|
||||
if (args['a'] || args['all']) {
|
||||
console.log(updateDocker());
|
||||
console.log(updateFlakeInputs());
|
||||
console.log(updateFirefoxAddons());
|
||||
console.log(updateVuetorrent());
|
||||
const flakeOutput = updateFlakeInputs();
|
||||
|
||||
console.log(flakeOutput);
|
||||
|
||||
|
||||
const dockerOutput = updateDocker();
|
||||
|
||||
console.log(dockerOutput);
|
||||
|
||||
|
||||
const firefoxOutput = updateFirefoxAddons();
|
||||
|
||||
console.log(firefoxOutput);
|
||||
|
||||
|
||||
const vuetorrentOutput = updateVuetorrent();
|
||||
|
||||
console.log(vuetorrentOutput);
|
||||
|
||||
|
||||
spawnSync('nix-fast-build', ['-f', `${FLAKE}#checks`], {
|
||||
shell: true,
|
||||
stdio: [process.stdin, process.stdout, process.stderr],
|
||||
});
|
||||
|
||||
console.log([
|
||||
'chore: update flake.lock',
|
||||
`Flake Inputs:\n${flakeOutput}`,
|
||||
`Docker Images:\n${dockerOutput}`,
|
||||
`Firefox Addons:\n${firefoxOutput}`,
|
||||
`Misc Sources:\n${vuetorrentOutput}`,
|
||||
].join('\n\n'));
|
||||
}
|
||||
|
||||
spawnSync('alejandra', ['-q', FLAKE], { shell: true });
|
||||
|
|
|
@ -14,8 +14,10 @@ export const updateFlakeInputs = () => {
|
|||
{ shell: true },
|
||||
).stdout
|
||||
.toString()
|
||||
// Add an extra blank line between inputs
|
||||
.split('\n•')
|
||||
.join('\n\n•')
|
||||
// Shorten git revs to help readability
|
||||
.split('\n')
|
||||
.map((l) => l
|
||||
.replace(/.{33}\?narHash=sha256[^']*/, '')
|
||||
|
|
Loading…
Reference in a new issue