FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TouchScript/Build/utils/sync_module.sh at develop · TouchScript/TouchScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
TouchScript
/
TouchScript
Public
Notifications
You must be signed in to change notification settings
Fork
366
Star
1.7k
Code
Issues
77
Pull requests
6
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
TouchScript
/
Build
/
utils
/
sync_module.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
48 lines (41 loc) · 1.14 KB
Breadcrumbs
TouchScript
/
Build
/
utils
/
sync_module.sh
Copy path
File metadata and controls
executable file
·
48 lines (41 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!
/bin/bash
#
1. Backs up tracked files by git
#
2. Copies everything from Source folder
#
3. Restores backed files
if
[[
$#
-eq
0 ]]
;
then
printf
"
\e[31mUsage: sync_module.sh <path to module folder>\e[39m\n
"
exit
0
fi
if
[
!
-d
"
${1}
"
]
;
then
printf
"
\e[31mError! Folder '
${1}
' does not exist.\e[39m\n
"
exit
0
fi
printf
"
\e[1;33mSynchronizing module
${1
##*/
}
.\e[0;39m\n
"
DIR=
"
$(
cd
"
$(
dirname
"
${BASH_SOURCE[0]}
"
)
"
&&
pwd
)
"
cd
"
$1
"
TMP=
"
./___tmp
"
rm -rf
$TMP
mkdir
$TMP
ROOTFOLDER=
"
Assets/TouchScript
"
IFS=
$'
\n
'
for
f
in
$(
git ls-tree -r --name-only HEAD
|
grep
"
^
$ROOTFOLDER
/
"
)
;
do
echo
"
$f
"
FOLDER=
$(
dirname
"
$f
"
)
/
FILENAME=
$(
basename
"
$f
"
)
TMPFOLDER=
"
$TMP
/
${FOLDER
##
$ROOTFOLDER
/
}
"
mkdir -p
"
$TMPFOLDER
"
if
(
!
cp
"
./
$f
"
"
$TMPFOLDER$FILENAME
"
)
;
then
printf
"
\e[31mError copying
$f
to
$TMPFOLDER$FILENAME
!\e[39m\n
"
exit
0
;
fi
done
rm -rf ./
$ROOTFOLDER
if
(
!
cp -rf
"
$DIR
/../../Source/Assets/TouchScript
"
"
./Assets/
"
)
;
then
printf
"
\e[31mError copying TouchScript to
${1}
!\e[39m\n
"
exit
0
;
fi
if
(
!
cp -r
"
$TMP
/.
"
"
./
$ROOTFOLDER
/
"
)
;
then
printf
"
\e[31mError copying temporary files to
${1}
!\e[39m\n
"
exit
0
;
fi
rm -rf
$TMP
Back
|
FazBrowse Home
|
New Git URL