From 9253a4b974f1c0e7cff48adcbb87b12a3a5dbf5b Mon Sep 17 00:00:00 2001 From: benn Date: Fri, 30 May 2025 16:16:30 +0200 Subject: [PATCH] Add codeberg as default repo --- nb_create.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nb_create.sh b/nb_create.sh index 74b29da..872f2fc 100755 --- a/nb_create.sh +++ b/nb_create.sh @@ -21,7 +21,7 @@ # # Default Git repository containing Makefile, NetBeans project file, ... # Override this using -r my_repo.git; or reset this -DEFAULT_REPO="/home/benn/share/home/repo/netbeans_proj/netbeans_generic.git" +DEFAULT_REPO="https://codeberg.org/mebenn/netbeans_generic.git/" this_script=$(basename -- $0) USE_PROGRAMME=git @@ -173,10 +173,11 @@ main() # Do # - echo "Checking out repo..." cd $pwd - # $(git clone $REPO .) + [ ! -d ".git" ] && echo "Checking out repo..." && $(git clone $REPO .) + [ ! -d ".git" ] && echo "ERROR: not a Git repo" && exit 1 + if_no_dir_then_exit $pwd/nbproject "Not a NetBeans project" if_no_file_then_exit $pwd/nbproject/project.xml "Netbeans project without a configuration file!" @@ -201,14 +202,14 @@ main() fi - exit 0 -# cd $pwd/nbproject -# sed -i -e "s/\(\).*\(<\/name>\(/$PROJECT<\/name>/g" project.xml -# -# cd "$pwd"/src -# if [ -f ./myapp.cpp ]; then -# mv myapp.cpp "$MAIN".cpp -# fi + + cd $pwd/nbproject + sed -i -e "s/.*<\/name>/$PROJECT/g" project.xml + + cd "$pwd"/src + if [ -f ./myapp.cpp ]; then + mv myapp.cpp "$MAIN".cpp + fi }