added default vscode launch config

This commit is contained in:
2025-04-25 20:29:19 +05:00
parent f0038dd7c7
commit 653d459999
4 changed files with 83 additions and 10 deletions

View File

@@ -89,18 +89,30 @@ do
else
mkdir -p "$new_project_dir"
fi
if ask_yn "create default cbuild project config?"; then
project_config_path="$new_project_dir/project.config"
cp "$CBUILD_INSTALL_DIR/default.config" "$project_config_path.temp"
myprint "Enter project name: "
read -r project_name
sed "s,\%PROJECT_NAME\%,$project_name,g" "$project_config_path.temp" > "$project_config_path"
rm "$project_config_path.temp"
myprint "${GREEN}created config at '$project_config_path'"
fi
# create project config
project_config_path="$new_project_dir/project.config"
cp "$CBUILD_INSTALL_DIR/default.config" "$project_config_path.temp"
myprint "Enter project name: "
read -r project_name
sed "s,\%PROJECT_NAME\%,$project_name,g" \
"$project_config_path.temp" > "$project_config_path"
rm "$project_config_path.temp"
myprint "${GREEN}created config at '$project_config_path'"
if ask_yn "Copy default .gitignore?"; then
cp "$CBUILD_INSTALL_DIR/.gitignore" "$new_project_dir/"
cp -v "$CBUILD_INSTALL_DIR/.gitignore" "$new_project_dir/"
fi
if ask_yn "Copy default .vscode launch tasks?"; then
new_project_vscode_dir="$new_project_dir/.vscode"
mkdir -p "$new_project_vscode_dir"
cp -vr "$CBUILD_INSTALL_DIR/default_vscode/"* "$new_project_vscode_dir/"
sed "s,\%PROJECT_NAME\%,$project_name,g" \
"$new_project_vscode_dir/launch.json" > "$new_project_vscode_dir/launch.json.temp"
mv "$new_project_vscode_dir/launch.json.temp" "$new_project_vscode_dir/launch.json"
fi
exit 0
;;
*)