woodpecker-cli: calling woodpecker instead of woodpecker-cli is now deprecated

according to upstream starting with v3.0.0.

Previously the opposite was true, so we simply invert the deprecation
wrapper added in ee4670a821.

Ref: 3d7e60beb0
This commit is contained in:
emilylange
2025-01-21 18:53:06 +01:00
parent d9e0922923
commit 3d47efdc1b
2 changed files with 7 additions and 9 deletions
@@ -18,6 +18,6 @@ buildGoModule {
meta = common.meta // {
description = "Command line client for the Woodpecker Continuous Integration server";
mainProgram = "woodpecker";
mainProgram = "woodpecker-cli";
};
}
@@ -18,18 +18,16 @@ in
cd $out/bin
for f in *; do
if [ "$f" = cli ]; then
mv -- "$f" "woodpecker"
# Issue a warning to the user if they call the deprecated executable
cat >woodpecker-cli << EOF
cat >woodpecker << EOF
#!/bin/sh
echo 'WARNING: calling \`woodpecker-cli\` is deprecated, use \`woodpecker\` instead.' >&2
$out/bin/woodpecker "\$@"
echo 'WARNING: calling \`woodpecker\` is deprecated, use \`woodpecker-cli\` instead.' >&2
$out/bin/woodpecker-cli "\$@"
EOF
chmod +x woodpecker-cli
patchShebangs woodpecker-cli
else
mv -- "$f" "woodpecker-$f"
chmod +x woodpecker
patchShebangs woodpecker
fi
mv -- "$f" "woodpecker-$f"
done
cd -
'';