about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAdam C. Stephens <2071575+adamcstephens@users.noreply.github.com>2024-02-13 21:25:13 -0500
committerGitHub <noreply@github.com>2024-02-13 21:25:13 -0500
commit89653a03e0915e4a872788d10680e7eec92f8600 (patch)
tree4842dfb8c4bee42c2df1a81926e37a4389619dc2 /pkgs
parent009e4ff8e380b87d6c752ec5343f3ec6e2c1e626 (diff)
parentee4670a8210d326e2de4f38f5cb7e87b24bd2264 (diff)
Merge pull request #287842 from ambroisie/woodpecker-cli
woodpecker: use upstream naming for cli executable
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/continuous-integration/woodpecker/cli.nix2
-rw-r--r--pkgs/development/tools/continuous-integration/woodpecker/common.nix14
2 files changed, 14 insertions, 2 deletions
diff --git a/pkgs/development/tools/continuous-integration/woodpecker/cli.nix b/pkgs/development/tools/continuous-integration/woodpecker/cli.nix
index d1f1da8816811..2121258f3c048 100644
--- a/pkgs/development/tools/continuous-integration/woodpecker/cli.nix
+++ b/pkgs/development/tools/continuous-integration/woodpecker/cli.nix
@@ -12,6 +12,6 @@ buildGoModule {
 
   meta = common.meta // {
     description = "Command line client for the Woodpecker Continuous Integration server";
-    mainProgram = "woodpecker-cli";
+    mainProgram = "woodpecker";
   };
 }
diff --git a/pkgs/development/tools/continuous-integration/woodpecker/common.nix b/pkgs/development/tools/continuous-integration/woodpecker/common.nix
index bad183d981256..b8fb8b871c647 100644
--- a/pkgs/development/tools/continuous-integration/woodpecker/common.nix
+++ b/pkgs/development/tools/continuous-integration/woodpecker/common.nix
@@ -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 -
   '';