#!/bin/bash basepath=$(dirname $0) server_prefix=/vant-weapp # convert relative path to absolute path function abspath() { pushd . > /dev/null; if [ -d "$1" ]; then cd "$1"; dirs -l +0; else cd "`dirname \"$1\"`"; cur_dir=`dirs -l +0`; if [ "$cur_dir" == "/" ]; then echo "$cur_dir`basename \"$1\"`"; else echo "$cur_dir/`basename \"$1\"`"; fi; fi; popd > /dev/null; } command_exists () { type "$1" >/dev/null 2>&1 } fontname() { echo "https://b.yzcdn.cn$server_prefix/$(basename $basepath/../assets/icons/build/font/zanui-weapp-icon-*.$1)" } # generate font files from sketch file $basepath/icons/extract-icons.sh $basepath/icons/generate-font.sh if command_exists superman ; then # upload to cdn superman cdn $server_prefix $basepath/../assets/icons/build/font/zanui-weapp-icon-* fi # generate fontface style eot=$(fontname eot) cat > $basepath/../packages/icon/index.pcss <> $basepath/../packages/icon/index.pcss