-
Notifications
You must be signed in to change notification settings - Fork 6
/
init
31 lines (24 loc) · 1.13 KB
/
init
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
#!/bin/sh
#package name
LC_ALL=C find . -type f -name '*.json' -exec sed -i '' "s/com.stansassets.package-sample/$1/g" {} +
LC_ALL=C find . -type f -name '*.cs' -exec sed -i '' "s/com.stansassets.package-sample/$1/g" {} +
LC_ALL=C find . -type f -name '*.md' -exec sed -i '' "s/com.stansassets.package-sample/$1/g" {} +
#namespace
LC_ALL=C find . -type f -name '*.cs' -exec sed -i '' "s/StansAssets.PackageSample/$2/g" {} +
LC_ALL=C find . -type f -name '*.asmdef' -exec sed -i '' "s/StansAssets.PackageSample/$2/g" {} +
#rename files
find . -type f -name 'StansAssets.PackageSample*' | while read FILE ; do
regexp="s/StansAssets.PackageSample/$2/";
newfile="$(echo ${FILE} | sed -e ${regexp})";
mv "${FILE}" "${newfile}";
done
mv 'com.stansassets.package-sample' "${1}";
PROJECT_NAME=$(echo "$2" | sed 's/^.*\.//')
mv 'PackageSampleProject' "${PROJECT_NAME}Project";
find . -type f -name 'com.stansassets.package-sample*' | while read FILE ; do
regexp="s/com.stansassets.package-sample/$1/";
newfile="$(echo ${FILE} | sed -e ${regexp})";
mv "${FILE}" "${newfile}";
done
echo "package name: $1"
echo "package namespace: $2"