Commit bed85ef6 authored by JosephK's avatar JosephK
Browse files

One shell script to preprae commons

parent 58a070af
{
"name": "vue-fs-commons",
"description": "Commons data, locales, plugin, assets and components for vue-fs",
"version": "21.12.2",
"version": "21.12.7",
"author": "JosephK",
"private": true
}
# Install packages
npm i
# Add commons symlink
if [[ ! -d commons ]]; then
ln -s node_modules/vue-fs-commons/src commons
fi
# Import hos translations
if [[ $(cat src/data/main.yml | grep -o 'hos: true') == "hos: true" ]]; then
for f in $(find ./node_modules/vue-fs-commons/src/translations -name 'hos.yml' -type f); do
lgdir=$(echo $f | cut -d '/' -f1,4-6);
if [ -d $lgdir ]; then
echo $lgdir/hos.yml ✓;
cp $f $lgdir/hos.yml;
else
echo $lgdir/hos.yml ✗;
fi;
done;
fi
# Import sfs translations
if [[ $(cat src/data/main.yml | grep -o 'sfs: true') == "sfs: true" ]]; then
for f in $(find ./node_modules/vue-fs-commons/src/translations -name 'sfs.yml' -type f); do
lgdir=$(echo $f | cut -d '/' -f1,4-6);
if [ -d $lgdir ]; then
echo $lgdir/sfs.yml ✓;
cp $f $lgdir/sfs.yml;
else
echo $lgdir/sfs.yml ✗;
fi
done
fi
# Import wiki
WikiAPI=$(cat src/data/main.yml | grep -Po 'api: \K.*');
WikiBase=$(cat src/data/main.yml | grep -Po 'base: \K.*');
WikiGit=$(echo $WikiBase | rev | cut -d '/' -f4- | rev).wiki.git;
if [[ "$WikiAPI" == *"http"* ]]; then
# Import wiki.json
wget "$WikiAPI" -O public/wiki.json
# Import uploads
if [ -d public/wiki ]; then
rm -rf public/wiki
fi
mkdir public/wiki
git clone $WikiGit public/wiki/tmp/
if [ -d public/wiki/tmp/uploads ]; then
mv public/wiki/tmp/uploads/* public/wiki/
fi
rm -rf public/wiki/tmp/
fi
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment