Files
Mārtiņš Možeiko fdab8bd6b2 add github actions
2021-11-14 18:13:28 -08:00

39 lines
965 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
###### Usage ##################################################################
# ./bld_init.sh
# Clears out the local folder and populates it with default initial scripts.
##### Declare The Local File Names ############################################
local_file_names=(
compiler.sh
compile_mode.sh
ctx.sh
linker.sh
arch.sh
)
###### Get Paths ##############################################################
og_path=$PWD
cd "$(dirname "$0")"
cd ..
root_path=$PWD
bin_path="$root_path/bin"
local_path="$root_path/local"
defs_path="$bin_path/local_defaults"
###### Copy Path ##############################################################
rm -rf $local_path
mkdir -p $local_path
for ((i=0; i<${#local_file_names[@]}; i+=1)); do
file_name=${local_file_names[i]}
cp $defs_path/default_$file_name $local_path/$file_name
done
###### Restore Path ###########################################################
cd $og_path