Add NPM scripts and update gitignore

remotes/origin/master
Guillaume Lesniak 2016-04-13 17:03:50 +02:00
parent 05d1c04ab7
commit 64babddd66
5 changed files with 57 additions and 5 deletions

7
.gitignore vendored
View File

@ -10,3 +10,10 @@ composer.lock
vendor/bin
migrations
*.sublime-*
vendor/
public/css/
public/js/
public/img/
public/views/
module/
node_modules/

View File

@ -9,5 +9,8 @@
"url": "ssh://gogs@rhea.netlor.fr:2222/monarc/skeleton.git"
},
"author": "Netlor",
"license": "Copyright"
"license": "Copyright",
"scripts": {
"postinstall": "./scripts/link_modules_resources.sh"
}
}

14
scripts/compile_translations.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
if [ -d node_modules/ng_backoffice ]; then
pushd node_modules/ng_backoffice
grunt compile_translations
grunt concat
fi
if [ -d node_modules/ng_client ]; then
pushd node_modules/ng_client
grunt compile_translations
grunt concat
fi

12
scripts/extract_translations.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ -d node_modules/ng_backoffice ]; then
pushd node_modules/ng_backoffice
grunt extract_translations
fi
if [ -d node_modules/ng_client ]; then
pushd node_modules/ng_client
grunt extract_translations
fi

View File

@ -8,13 +8,29 @@ if [ ! -d public/views ]; then
mkdir public/views
fi
if [ ! -d public/img ]; then
mkdir public/img
fi
if [ -d node_modules/ng_backoffice ]; then
find node_modules/ng_backoffice/views -name "*.html" -exec ln -s $(realpath {}) public/views/ \;
find node_modules/ng_backoffice/src -name "*.js" -exec ln -s $(realpath {}) public/js/ \;
find node_modules/ng_backoffice/views -name "*.html" -exec ln -s $(realpath {}) public/views/ \; 2>/dev/null
find node_modules/ng_backoffice/src -name "*.js" -exec ln -s $(realpath {}) public/js/ \; 2>/dev/null
find node_modules/ng_backoffice/css -name "*.css" -exec ln -s $(realpath {}) public/css/ \; 2>/dev/null
find node_modules/ng_backoffice/img -name "*" -exec ln -s $(realpath {}) public/img/ \; 2>/dev/null
pushd node_modules/ng_backoffice
grunt concat
popd
fi
if [ -d node_modules/ng_client ]; then
find node_modules/ng_client/views -name "*.html" -exec ln -s {} public/views/ \;
find node_modules/ng_client/src -name "*.js" -exec ln -s {} public/js/ \;
find node_modules/ng_client/views -name "*.html" -exec ln -s $(realpath {}) public/views/ \; 2>/dev/null
find node_modules/ng_client/src -name "*.js" -exec ln -s $(realpath {}) public/js/ \; 2>/dev/null
find node_modules/ng_client/css -name "*.css" -exec ln -s $(realpath {}) public/css/ \; 2>/dev/null
find node_modules/ng_client/img -name "*" -exec ln -s $(realpath {}) public/img/ \; 2>/dev/null
pushd node_modules/ng_backoffice
grunt concat
popd
fi