Files
winix/.templates/install_clangd.sh
T
tomasz.sowa 98ba7450a4 allow to force installing a clangd and qtcreator files
Add new targets to the Makefile:
- forceclangd - allow to force installing a .clangd file
- forceclangdall - force installing .clangd file in this project and in libriaries:
  pikotools, morm, ezc and tito
- forceqtcreator - force installing qtcreator files
- forceqtcreatorall - force installing qtcreator files in this project and in libraries
Existing files will be overwritten.

while here:
- update the c++ standard to c++23
2026-08-18 00:03:39 +02:00

39 lines
915 B
Bash
Executable File

#!/bin/sh
CURRENT_DIR=$(pwd)
GLOBAL_WORKING_DIR=$(realpath ${CURRENT_DIR}/..)
# ----------
has_force_arg=0
if [ $# -eq 1 ] ; then
if [ $1 == 'force' ] ; then
has_force_arg=1
fi
fi
# make sure the current directory is correct
if [ ! -d ${CURRENT_DIR}/.templates ] ; then
echo "this script should be called by make: make clangd (one level up)"
exit 1
fi
# change / to \/ in paths
CURRENT_DIR_FOR_SED=$(echo ${CURRENT_DIR} | sed 's/\//\\\//g')
GLOBAL_WORKING_DIR_FOR_SED=$(echo ${GLOBAL_WORKING_DIR} | sed 's/\//\\\//g')
if [ -f "${CURRENT_DIR}/.templates/.clangd" ] ; then
if [ $has_force_arg -eq 1 -o ! -f "${CURRENT_DIR}/.clangd" ] ; then
cat "${CURRENT_DIR}/.templates/.clangd" | \
sed -e "s/%%%CURRENT_DIR%%%/${CURRENT_DIR_FOR_SED}/g" \
-e "s/%%%GLOBAL_WORKING_DIR%%%/${GLOBAL_WORKING_DIR_FOR_SED}/g" > \
${CURRENT_DIR}/.clangd
echo "added a ${CURRENT_DIR}/.clangd file"
fi
fi