File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,20 @@ FOLDER=$(
66)
77TARGET_PATH=" ${FOLDER} /aaa"
88
9- COPYFILE_DISABLE=1 tar -zcvf ${TARGET_PATH} \
10- --exclude=dist* / \
11- --exclude=.git/ \
12- --exclude=package-lock.json \
13- --exclude=node_modules \
14- --exclude=firefox_dev* / \
15- --exclude=market_packages \
16- --exclude=aaa \
17- ./
9+ EXCLUDE_ARGS=" "
10+
11+ if [ -f " ${FOLDER} /.gitignore" ]; then
12+ while IFS= read -r line || [ -n " $line " ]; do
13+ [[ -z " $line " || " $line " =~ ^# ]] && continue
14+ line= $( echo " $line " | sed ' s/^[[:space:]]*//;s/[[:space:]]*$//' )
15+ [ -z " $line " ] && continue
16+
17+ pattern= " ${line#/ } "
18+ EXCLUDE_ARGS= " ${EXCLUDE_ARGS} --exclude=${pattern} "
19+ done < " ${FOLDER} /.gitignore"
20+ fi
21+
22+ EXCLUDE_ARGS= " ${EXCLUDE_ARGS} --exclude=.git"
23+
24+ cd " ${FOLDER} "
25+ COPYFILE_DISABLE= 1 tar -z cf ${TARGET_PATH} ${EXCLUDE_ARGS} ./
You can’t perform that action at this time.
0 commit comments