From 27564303b4c0e0b569141afcf6c6513c74b17ff7 Mon Sep 17 00:00:00 2001 From: Oxbian Date: Sat, 8 Feb 2025 14:56:35 -0500 Subject: feat: improving C setup, adding Python setup --- C/setup.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 C/setup.sh (limited to 'C/setup.sh') diff --git a/C/setup.sh b/C/setup.sh new file mode 100755 index 0000000..d53c8f5 --- /dev/null +++ b/C/setup.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env sh +# Setup a C environment using ArKa coding style + +vcs=true +project_name="$1" +script_dir="$(cd "$(dirname "$0")" && pwd)" + +# Parsing args +for arg in "$@"; do + if [ "$arg" = "--no-vcs" ]; then + vcs=false + else + project_name="$arg" + fi +done + +if [ -n "$project_name" ]; then + printf "Installing your environment...\n" + mkdir -p "$project_name" || exit + cd "$project_name" + + # If vcs is true, init git in the project + if [ "$vcs" = true ]; then + printf "Setting up git in %s\n" "$project_name" + git init + cp "$script_dir"/.gitignore .gitignore + fi + + printf "Setting up C environment + clangd config\n" + cp "$script_dir"/.clang-format .clang-format + # copy linters, formatters config + printf "Your C environment is now ready, enjoy :)\n" +else + printf "Usage:\n\t%s [--no-vcs] {dirname}\n\n\t--no-vcs: git vcs not added to the project\n" "$0" +fi + + -- cgit v1.2.3