nixpkgs-tools/treewideMainProgram/ed_main_program.sh

16 lines
308 B
Bash
Raw Normal View History

2023-11-27 02:36:30 +01:00
#!/usr/bin/env bash
PACKAGE_PATH=$1
PACKAGE_NAME=$1
if [ -f $1 ]; then
PACKAGE_NAME=$(dirname $PACKAGE_NAME)
else
PACKAGE_PATH="${PACKAGE_PATH%%/}/default.nix"
fi
PACKAGE_NAME="${PACKAGE_NAME%/}"
PACKAGE_NAME="${PACKAGE_NAME##*/}"
NVIM_CLIPBOARD="mainProgram = \"$PACKAGE_NAME\";" nvim $PACKAGE_PATH