代码拉取完成,页面将自动刷新
同步操作将从 Ilyaerokhin/ark_theme 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# release build by default
isRelease=true
# out path
out=./out
# release file path
release=./out/arkStyles.js
# debug file path
debug=./out/arkStyles_debug.js
# engine path
engine=./engine
# engine output path
engine_output=./engine/arkStyles.js
# read arguments
# -d means debug build with console.log usages
while getopts d OPT
do
case "$OPT" in
d) isRelease=false ;;
?) ;;
esac
done
# remove last output
if [ -d "$out" ]; then
rm -rf $out
fi
# compile solution
tsc --build tsconfig.json
# remove stabs
sed -i '/<!-- BOF CLEAN -->/,/<!-- EOF CLEAN -->/d' $release
# remove shapes tokens usage
sed -i '/if (SHAPES_TOKENS_ARE_ENABLED)/,/SHAPES_TOKENS_ARE_ENABLED END/d' $release
# remove typography tokens usage
sed -i '/if (TYPOGRAPHY_TOKENS_ARE_ENABLED)/,/TYPOGRAPHY_TOKENS_ARE_ENABLED END/d' $release
# remove other tokens usage
sed -i '/if (OTHER_TOKENS_ARE_ENABLED)/,/OTHER_TOKENS_ARE_ENABLED END/d' $release
# add header
sed -i '1i /*' $release
sed -i '2i \ * Copyright (c) 2024 Huawei Device Co., Ltd.' $release
sed -i '3i \ * Licensed under the Apache License, Version 2.0 (the "License");' $release
sed -i '4i \ * you may not use this file except in compliance with the License.' $release
sed -i '5i \ * You may obtain a copy of the License at' $release
sed -i '6i \ *' $release
sed -i '7i \ * http://www.apache.org/licenses/LICENSE-2.0' $release
sed -i '8i \ *' $release
sed -i '9i \ * Unless required by applicable law or agreed to in writing, software' $release
sed -i '10i\ * distributed under the License is distributed on an "AS IS" BASIS,' $release
sed -i '11i\ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.' $release
sed -i '12i\ * See the License for the specific language governing permissions and' $release
sed -i '13i\ * limitations under the License.' $release
sed -i '14i\ */' $release
sed -i '15i /* THIS IS AUTOGENERATED FILE, PLEASE DON`T CHANGE IT MANUALLY */' $release
# copy debug version
cp $release $debug
# remove logs for release version
sed -i '/console.log/d' $release
# move library to 'engine' dirrectory
if [ ! -d "$engine" ];
then
mkdir $engine
else
rm $engine_output
fi
if "$isRelease"
then
cp $release $engine_output
else
cp $debug $engine_output
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。