22 lines
544 B
TypeScript
22 lines
544 B
TypeScript
|
import { readdirSync } from 'node:fs';
|
||
|
import { spawnSync } from 'node:child_process';
|
||
|
|
||
|
|
||
|
/* Constants */
|
||
|
const FLAKE = process.env.FLAKE;
|
||
|
|
||
|
export const updateDocker = () => {
|
||
|
let updates = '';
|
||
|
|
||
|
const FILE = `${FLAKE}/devices/nos/modules/arion`;
|
||
|
|
||
|
readdirSync(FILE, { withFileTypes: true, recursive: true }).forEach((path) => {
|
||
|
if (path.name === 'compose.nix') {
|
||
|
updates += spawnSync('updateImages', [path.parentPath], { shell: true })
|
||
|
.stdout.toString();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return updates;
|
||
|
};
|