fix(update): get latest tag instead of release for grosshack
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-02-15 11:55:05 -05:00
parent 853552493f
commit 1c8b80283e
3 changed files with 19 additions and 9 deletions

View file

@ -1,8 +1,10 @@
{ {
buildApp, buildApp,
callPackage, callPackage,
curl,
findutils, findutils,
go, go,
jq,
nix-update, nix-update,
nodejs_latest, nodejs_latest,
prefetch-npm-deps, prefetch-npm-deps,
@ -13,8 +15,10 @@ buildApp {
npmDepsHash = "sha256-2cWxVTCOEJOg2eBv+xX/mvr6MUX+UJQ8JlkoObD6+Uc="; npmDepsHash = "sha256-2cWxVTCOEJOg2eBv+xX/mvr6MUX+UJQ8JlkoObD6+Uc=";
runtimeInputs = [ runtimeInputs = [
curl
findutils findutils
go go
jq
nix-update nix-update
nodejs_latest nodejs_latest
prefetch-npm-deps prefetch-npm-deps

View file

@ -67,10 +67,12 @@ const main = async() => {
console.log(await updateNodeModules()); console.log(await updateNodeModules());
} }
// TODO: get latest tag instead of release if (args['p'] || args['pam-fprint-grosshack']) {
// if (args['p'] || args['pam-fprint-grosshack']) { console.log(runNixUpdate(
// console.log(runNixUpdate('pam-fprint-grosshack')); 'pam-fprint-grosshack',
// } ['--version="$(curl -s https://gitlab.com/api/v4/projects/mishakmak%2Fpam-fprint-grosshack/repository/tags | jq -r .[0].name)"'],
));
}
if (args['ph'] || args['protonhax']) { if (args['ph'] || args['protonhax']) {
console.log(runNixUpdate('protonhax')); console.log(runNixUpdate('protonhax'));
@ -129,8 +131,8 @@ const main = async() => {
// nix-update executions // nix-update executions
let nixUpdateOutputs = ''; let nixUpdateOutputs = '';
const updatePackage = (pkg: string): void => { const updatePackage = (pkg: string, opts: string[] = []): void => {
const execution = runNixUpdate(pkg); const execution = runNixUpdate(pkg, opts);
nixUpdateOutputs += execution.stdout; nixUpdateOutputs += execution.stdout;
console.log(execution.stderr); console.log(execution.stderr);
@ -139,7 +141,10 @@ const main = async() => {
updatePackage('homepage'); updatePackage('homepage');
updatePackage('jmusicbot'); updatePackage('jmusicbot');
// updatePackage('pam-fprint-grosshack'); updatePackage(
'pam-fprint-grosshack',
['--version="$(curl -s https://gitlab.com/api/v4/projects/mishakmak%2Fpam-fprint-grosshack/repository/tags | jq -r .[0].name)"'],
);
updatePackage('protonhax'); updatePackage('protonhax');
updatePackage('trash-d'); updatePackage('trash-d');
updatePackage( updatePackage(

View file

@ -59,8 +59,9 @@ export const runNixUpdate = (
const OLD_VERSION = getAttrVersion(attr); const OLD_VERSION = getAttrVersion(attr);
const execution = spawnSync( const execution = spawnSync(
`nix-update --flake ${attr} --write-commit-message >(head -n 1 -) > /dev/null`, `nix-update --flake ${attr} ${options
options, .join(' ')} --write-commit-message >(head -n 1 -) > /dev/null`,
[],
{ shell: true, cwd: FLAKE }, { shell: true, cwd: FLAKE },
); );