Custom dynamic variable generation script
This commit is contained in:
parent
4d6310600b
commit
4d5bf40aff
16
README.md
16
README.md
@ -2,14 +2,14 @@ This repository contains general build scripts and pipelines for all languages t
|
||||
```bash
|
||||
#Short description about what I do
|
||||
#Language[Folder]
|
||||
/* The script's code goes in here.
|
||||
rm -Rf out/*
|
||||
javac -Xlint:unchecked -cp ${PROJECT_DIR}/.. -d ${OUT_DIR} ${PROJECT_DIR}/*.java
|
||||
printf "\n\n\nRunning Program...\n\n"
|
||||
cd $OUT_DIR
|
||||
java ${MAIN_CLASS} "$@"
|
||||
../scripts/clean.sh
|
||||
*/
|
||||
# #The script's code goes in here.
|
||||
# rm -Rf out/*
|
||||
# javac -Xlint:unchecked -cp ${PROJECT_DIR}/.. -d ${OUT_DIR} ${PROJECT_DIR}/*.java
|
||||
# printf "\n\n\nRunning Program...\n\n"
|
||||
# cd $OUT_DIR
|
||||
# java ${MAIN_CLASS} "$@"
|
||||
# ../scripts/clean.sh
|
||||
|
||||
```
|
||||
Each language will be in the following structure:
|
||||
```
|
||||
|
6
scripts/commit.sh
Executable file
6
scripts/commit.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#Adds a commit message and pushes project to github repository.
|
||||
#
|
||||
git add -u
|
||||
git add *
|
||||
git commit -m "$*"
|
||||
git push
|
17
sig
17
sig
@ -1,8 +1,9 @@
|
||||
export PROJECT_NAME="JavaProjectTemplate"
|
||||
export PROJECT_DIR="src/sig"
|
||||
export MAIN_CLASS="sig.${PROJECT_NAME}"
|
||||
export OUT_DIR="bin"
|
||||
source utils/define.sh
|
||||
|
||||
define PROJECT_NAME "JavaProjectTemplate"
|
||||
define PROJECT_DIR "src/sig"
|
||||
define MAIN_CLASS "sig.${PROJECT_NAME}"
|
||||
define OUT_DIR "bin"
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
@ -11,10 +12,10 @@ if [ -z "$1" ]
|
||||
echo ""
|
||||
printf "====\tCurrent Configuration"
|
||||
printf "\t====================="
|
||||
printf "\n\t%-15s%20s" PROJECT_NAME ${PROJECT_NAME}
|
||||
printf "\n\t%-15s%20s" PROJECT_DIR ${PROJECT_DIR}
|
||||
printf "\n\t%-15s%20s" MAIN_CLASS ${MAIN_CLASS}
|
||||
printf "\n\t%-15s%20s" OUT_DIR ${OUT_DIR}
|
||||
for t in ${VARS[@]}
|
||||
do
|
||||
printf "\n\t%-15s%20s" $t ${!t}
|
||||
done
|
||||
printf "\n====================================================="
|
||||
echo ""
|
||||
echo ""
|
||||
|
7
utils/define.sh
Executable file
7
utils/define.sh
Executable file
@ -0,0 +1,7 @@
|
||||
export VARS=("")
|
||||
|
||||
function define() {
|
||||
VARS+=("$1")
|
||||
value="${*:2}"
|
||||
eval "$1"='$value'
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user