diff --git a/flake.nix b/flake.nix index 16965e9..67b2902 100644 --- a/flake.nix +++ b/flake.nix @@ -13,14 +13,13 @@ outputs = { self, nixpkgs, flake-utils}: in { packages.default = pkgs.writeShellApplication { name = "ngcp"; - text = ./ngcp.sh; + text = builtins.readFile ./ngcp.sh; runtimeInputs = with pkgs; [ git libnotify jq ]; }; - mainProgram = "ngpcp"; apps.default = { type = "app"; program = "${self.packages.${system}.default}/bin/ngcp"; diff --git a/ngcp.sh b/ngcp.sh index d5f6327..c7a38c1 100755 --- a/ngcp.sh +++ b/ngcp.sh @@ -1,6 +1,11 @@ set -euo pipefail trap 'echo "Interrupted or failed. Repo may be mid-rebase/cherry-pick." ; exit 1' INT ERR +if [[ $# -eq 0 ]]; then + echo "Usage: ngcp [mode] [options]" + echo "Run 'ngcp --help' for more information." + exit 1 +fi # waits for an internet connection. It pings both Google DNS and Cloudfare dns in case one of them is down pings=0