代码拉取完成,页面将自动刷新
#!/bin/bash
# Copy the boilerplate to the target
cp -rf templates/fragment src/$1
echo "$FUN_FRAGMENT_NAME $FUN_PORT" >> registry
# cp -rf templates/boilerplate src/$1
cd src/$1
mv components/component.js components/$FUN_FRAGMENT_NAME.js
# Author of script: https://github.com/cagataycali
# Original source: https://gist.github.com/cagataycali/917a90113aa7ac4819114fd45d9e0d2c
prefix="FUN_"
# Usage: FUN_PROVIDER='test' FUN_CAGATAY='CALI' ./replace.sh
# echo $FUN_DIRNAME
# The for loop below is taken from here:
# https://stackoverflow.com/questions/39529648/how-to-iterate-through-all-the-env-variables-printing-key-and-value
unset IFS
for var in "${!FUN_@}"; do
glob="s|#$var|${!var}|g"
# Debug with uncomment below echo.
# echo $glob # Will replace if the FUN_PROVIDER='TEST'
# The find code is taken from: https://superuser.com/a/537037
find . -type f -name "*" -not -path '*/\.git/*' -not -path '*/\node_modules/*' -exec sed -i'' -e $glob {} + 2> /dev/null
done
rm **/*-e 2> /dev/null
rm *-e 2> /dev/null
rm **/.*-e 2> /dev/null
rm .*-e 2> /dev/null
echo 'Cleanup success'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。