fix(update): get rid of shell deprecation msg

This commit is contained in:
matt1432 2025-05-10 14:16:55 -04:00
commit 1c22784064
9 changed files with 30 additions and 32 deletions

View file

@ -148,11 +148,11 @@ const main = async() => {
updatePackage('scopedPackages', 'lovelace-components', 'material-rounded-theme');
spawnSync('alejandra', ['-q', FLAKE], { shell: true });
spawnSync(`alejandra -q ${FLAKE}`, [], { shell: true });
spawnSync('nixFastBuild', [], {
shell: true,
stdio: [process.stdin, process.stdout, process.stderr],
stdio: 'inherit',
});
const indentOutput = (output: string): string => {
@ -198,7 +198,7 @@ const main = async() => {
}
}
else {
spawnSync('alejandra', ['-q', FLAKE], { shell: true });
spawnSync(`alejandra -q ${FLAKE}`, [], { shell: true });
}
};

View file

@ -52,9 +52,9 @@ export default (): string | null => {
{ shell: true, cwd: '/tmp' },
);
const plugins = JSON.parse(spawnSync('nix',
['eval', '-f', `${dir}/plugins.nix`, '--json'],
{ shell: true }).stdout.toString()).plugins as Record<string, Plugin>;
const plugins = JSON.parse(spawnSync(
['nix', 'eval', '-f', `${dir}/plugins.nix`, '--json'].join(' '), [], { shell: true },
).stdout.toString()).plugins as Record<string, Plugin>;
// Get most recent versions of plugins
Object.entries(plugins).forEach(([key, value]) => {

View file

@ -9,7 +9,7 @@ const FLAKE = process.env.FLAKE;
const updateImages = (imagePath: string): string | undefined => {
console.log(`Updating ${imagePath.split('/').at(-1)} images`);
const out = spawnSync('updateImages', [imagePath], { shell: true }).stdout.toString();
const out = spawnSync(`updateImages ${imagePath}`, [], { shell: true }).stdout.toString();
if (out.length > 1) {
return out;

View file

@ -26,13 +26,14 @@ export default (): string | null => {
y.type == "derivation") (attrValues x))
'`;
const OLD_VERS = Object.fromEntries([...JSON.parse(spawnSync('nix', [
const OLD_VERS = Object.fromEntries([...JSON.parse(spawnSync([
'nix',
'eval',
'.#scopedPackages.x86_64-linux.firefoxAddons',
'--apply',
nixExpr,
'--json',
], { shell: true }).stdout.toString())]
].join(' '), [], { shell: true }).stdout.toString())]
.map((p) => {
const pname = p.replace(/-[0-9].*$/, '');
@ -40,12 +41,9 @@ export default (): string | null => {
})
.filter((pinfo) => pinfo[0] !== 'frankerfacez'));
const NEW_VERS = Object.fromEntries(spawnSync(
'nix',
['run', 'sourcehut:~rycee/mozilla-addons-to-nix',
SLUGS, GENERATED_FILE],
{ shell: true },
).stdout
const NEW_VERS = Object.fromEntries(spawnSync([
'nix', 'run', 'sourcehut:~rycee/mozilla-addons-to-nix', SLUGS, GENERATED_FILE,
].join(' '), [], { shell: true }).stdout
.toString()
.split('\n')
.map((p) => {

View file

@ -32,8 +32,8 @@ export const parseArgs = (): Args => {
};
export const parseFetchurl = (url: string): string => JSON.parse(spawnSync(
'nix', ['store', 'prefetch-file', '--refresh', '--json',
'--hash-type', 'sha256', url, '--name', '"escaped"'], { shell: true },
['nix', 'store', 'prefetch-file', '--refresh', '--json',
'--hash-type', 'sha256', url, '--name', '"escaped"'].join(' '), [], { shell: true },
).stdout.toString()).hash;
export const replaceInFile = (replace: RegExp, replacement: string, file: string): void => {

View file

@ -13,9 +13,9 @@ export default (): string | null => {
const OLD_VERSION = readFileSync(`${FOLDER}/.version`).toString().replace('\n', '');
const VERSION = JSON.parse(spawnSync('curl',
['-s', 'https://api.github.com/repos/net-daemon/netdaemon/releases/latest'],
{ shell: true }).stdout.toString()).tag_name.replace('v', '');
const VERSION = JSON.parse(spawnSync([
'curl', '-s', 'https://api.github.com/repos/net-daemon/netdaemon/releases/latest',
].join(' '), [], { shell: true }).stdout.toString()).tag_name.replace('v', '');
if (OLD_VERSION !== VERSION) {
writeFileSync(`${FOLDER}/.version`, `${VERSION}\n`);

View file

@ -5,9 +5,9 @@ import { styleText } from 'node:util';
/* Constants */
const FLAKE = process.env.FLAKE;
const getAttrVersion = (attr: string): string => spawnSync('nix',
['eval', '--raw', `${FLAKE}#${attr}.version`],
{ shell: true }).stdout.toString();
const getAttrVersion = (attr: string): string => spawnSync(
['nix', 'eval', '--raw', `${FLAKE}#${attr}.version`].join(' '), [], { shell: true },
).stdout.toString();
export default (
attr: string,

View file

@ -19,9 +19,9 @@ const updatePackageJson = async(workspaceDir: string, updates: object) => {
const updateDeps = (deps: string) => {
Object.keys(currentPackageJson[deps]).forEach(async(dep) => {
if (dep === 'astal') {
const latestCommit = JSON.parse(spawnSync('curl',
['-s', 'https://api.github.com/repos/Aylur/astal/commits/main'],
{ shell: true }).stdout.toString()).sha;
const latestCommit = JSON.parse(spawnSync(
['curl', '-s', 'https://api.github.com/repos/Aylur/astal/commits/main'].join(' '), [], { shell: true },
).stdout.toString()).sha;
currentPackageJson[deps][dep] = `https://gitpkg.vercel.app/Aylur/astal/lang/gjs/src?${latestCommit}`;

View file

@ -25,13 +25,13 @@ export default (): string | null => {
const FILE = `${FLAKE}/configurations/nos/modules/qbittorrent/vuetorrent.nix`;
const OLD_VERSION = JSON.parse(spawnSync('nix',
['eval', '-f', FILE, '--json'],
{ shell: true }).stdout.toString()).version;
const OLD_VERSION = JSON.parse(spawnSync(
['nix', 'eval', '-f', FILE, '--json'].join(' '), [], { shell: true },
).stdout.toString()).version;
const VERSION = JSON.parse(spawnSync('curl',
['-s', 'https://api.github.com/repos/VueTorrent/VueTorrent/releases/latest'],
{ shell: true }).stdout.toString()).tag_name.replace('v', '');
const VERSION = JSON.parse(spawnSync(
['curl', '-s', 'https://api.github.com/repos/VueTorrent/VueTorrent/releases/latest'].join(' '), [], { shell: true },
).stdout.toString()).tag_name.replace('v', '');
const URL = `https://github.com/VueTorrent/VueTorrent/releases/download/v${VERSION}/vuetorrent.zip`;
const HASH = parseFetchurl(URL);