poco/build/script/projname
Aleksandar Fabijanic 701c8dae2d
Build and dev system improvements (#4193)
* fix shellcheck warnings; add some ci ignore test entries

* fix(make): Redirect build stderr to a file #4112

* enh(dev): add vscode run script and launch items for tests
2023-10-18 18:48:20 +02:00

18 lines
375 B
Bash
Executable File

#! /bin/sh
#
# projname
#
# Usage: projname PROJECT_BASE
#
# Extract the project name from the current path
# NOTE: the cd $PROJECT_BASE is necessary to resolve symbolic links,
# ditto is the kinda strange sh -c pwd
#
PROJECT_BASE=$1
cdir=$(sh -c pwd)
cd "$PROJECT_BASE" || exit
projbase=$(sh -c pwd)
cd "$cdir" || exit
sh -c pwd | sed "s:^$projbase::" | sed "s:^/::"