From 1b4e950e39c74751000f39b211c50006590d6858 Mon Sep 17 00:00:00 2001 From: Guillaume Lesniak Date: Tue, 26 Apr 2016 15:55:13 +0200 Subject: [PATCH] link_modules_resources: Check for realpath on all platforms --- scripts/link_modules_resources.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/link_modules_resources.sh b/scripts/link_modules_resources.sh index e2af6bb..4d03c71 100755 --- a/scripts/link_modules_resources.sh +++ b/scripts/link_modules_resources.sh @@ -1,13 +1,15 @@ #!/bin/bash -if [[ "$OSTYPE" == "darwin"* ]]; then +# Check if we have realpath +which realpath >/dev/null 2>/dev/null +if [ $? == "1" ]; then # Mac OS X doesn't have realpath realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } fi - +# Ensure folders are existing if [ ! -d public/js ]; then mkdir public/js fi @@ -23,6 +25,7 @@ if [ ! -d public/img ]; then mkdir public/img fi +# Link modules resources if [ -d node_modules/ng_backoffice ]; then find node_modules/ng_backoffice/views -maxdepth 1 -name "*.html" -exec ln -s $(realpath {}) public/views/ \; 2>/dev/null find node_modules/ng_backoffice/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s $(realpath {}) public/views/dialogs/ \; 2>/dev/null