mirror of
https://github.com/ProjectSkyfire/SkyFire_548
synced 2026-08-18 06:32:13 -04:00
YYYY_MM_DD_auth_XY.sql
Automatically creates the file using Skyfire / TC Strucutre and grabs teh current folder name using the speicfic format and increments +1 if it already exist 2026_01_29_auth_00.sql 2026_01_29_auth_01.sql 2026_01_29_auth_02.sql etc...
This commit is contained in:
parent
1172f8c6a9
commit
d99da40802
1 changed files with 24 additions and 0 deletions
24
sql/updates/world/create_sql.sh
Normal file
24
sql/updates/world/create_sql.sh
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
unamestr=`uname`
|
||||
echo "--" > "$CUR_PATH/$filename" && echo "File created: $filename";
|
||||
if [[ "$unamestr" == 'Darwin' ]]; then
|
||||
datecmd='gdate'
|
||||
else
|
||||
datecmd='date'
|
||||
fi
|
||||
|
||||
CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )"
|
||||
FOLDER_NAME=$(basename "$CUR_PATH")
|
||||
DATE_STR=$($datecmd +%Y_%m_%d)
|
||||
|
||||
idx=0
|
||||
while : ; do
|
||||
filename="${DATE_STR}_${FOLDER_NAME}_$(printf '%02d' $idx).sql"
|
||||
if [[ ! -e "$CUR_PATH/$filename" ]]; then
|
||||
break
|
||||
fi
|
||||
idx=$((idx+1))
|
||||
done
|
||||
|
||||
echo "--" > "$CUR_PATH/$filename" && echo "File created: $filename"
|
||||
Loading…
Add table
Add a link
Reference in a new issue