Skip to content

Commit 941c9d0

Browse files
committed
enhancement #30: adding scripts to configure project
1 parent 42cd7a2 commit 941c9d0

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

scripts/setup_git_hooks.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Define the source and destination directories
4+
SOURCE_DIR="$(git rev-parse --show-toplevel)/scripts/git_hooks"
5+
DEST_DIR="$(git rev-parse --show-toplevel)/.git/hooks"
6+
7+
# Check if the git repository root is found
8+
if [ -z "$DEST_DIR" ]; then
9+
echo "Error: This script must be run within a git repository."
10+
exit 1
11+
fi
12+
13+
# Create the destination directory if it doesn't exist
14+
mkdir -p "$DEST_DIR"
15+
16+
# Copy the git_hooks folder to the destination
17+
cp -r "$SOURCE_DIR/"* "$DEST_DIR"
18+
19+
# Make scripts executable
20+
chmod +x "$DEST_DIR"/*
21+
22+
echo "git hooks copied in $DEST_DIR"

scripts/setup_vscode.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Define the source and destination directories
4+
SOURCE_DIR="$(git rev-parse --show-toplevel)/scripts/vscode"
5+
DEST_DIR="$(git rev-parse --show-toplevel)/.vscode"
6+
7+
# Check if the git repository root is found
8+
if [ -z "$DEST_DIR" ]; then
9+
echo "Error: This script must be run within a git repository."
10+
exit 1
11+
fi
12+
13+
# Create the destination directory if it doesn't exist
14+
mkdir -p "$DEST_DIR"
15+
16+
# Copy the vscode folder to the destination
17+
cp -r "$SOURCE_DIR/"* "$DEST_DIR"
18+
19+
echo "vscode config has been copied to $DEST_DIR"

scripts/vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"black-formatter.importStrategy": "fromEnvironment",
3+
"isort.check": true,
4+
"isort.importStrategy": "fromEnvironment",
5+
"editor.formatOnSave": true,
6+
"editor.codeActionsOnSave": {
7+
"source.organizeImports": "explicit"
8+
},
9+
"isort.args": [
10+
"--profile",
11+
"black"
12+
],
13+
}

0 commit comments

Comments
 (0)