Merge pull request #287842 from ambroisie/woodpecker-cli

woodpecker: use upstream naming for cli executable
This commit is contained in:
Adam C. Stephens 2024-02-13 21:25:13 -05:00 committed by GitHub
commit 89653a03e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -12,6 +12,6 @@ buildGoModule {
meta = common.meta // {
description = "Command line client for the Woodpecker Continuous Integration server";
mainProgram = "woodpecker-cli";
mainProgram = "woodpecker";
};
}

View File

@ -17,7 +17,19 @@ in
postInstall = ''
cd $out/bin
for f in *; do
mv -- "$f" "woodpecker-$f"
if [ "$f" = cli ]; then
mv -- "$f" "woodpecker"
# Issue a warning to the user if they call the deprecated executable
cat >woodpecker-cli << EOF
#/bin/sh
echo 'WARNING: calling `woodpecker-cli` is deprecated, use `woodpecker` instead.' >&2
$out/bin/woodpecker "\$@"
EOF
chmod +x woodpecker-cli
patchShebangs woodpecker-cli
else
mv -- "$f" "woodpecker-$f"
fi
done
cd -
'';