Skip to content

Commit 072504a

Browse files
Create shell script to create folder structure
This commit was made to create a script to eliminate the time to copy and paste folders for new programming languages Signed-off-by: darrylbalderas <[email protected]>
1 parent a160ef6 commit 072504a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

createFolders.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
PROJECT_NAME=data-and-algorithms
4+
DIRECTORY=${PWD}
5+
BASE_DIRECTORY=$(echo "$DIRECTORY" | rev | cut -d "/" -f1 | rev)
6+
7+
if [[("$1" != "")]]; then
8+
if [[("$BASE_DIRECTORY" != "$PROJECT_NAME")]]; then
9+
echo "Make sure you are in $PROJECT_NAME project"
10+
exit
11+
fi
12+
rootfileName=$1
13+
mkdir ./$rootfileName
14+
cp -a ./Python/ ./$rootfileName/
15+
rm ./$rootfileName/*/*/*.py
16+
else
17+
echo "Missing folder name: sh createFolders.sh <folder_name>"
18+
fi

0 commit comments

Comments
 (0)