Skip to content
Snippets Groups Projects
Commit d4b96bf0 authored by al.schwinn's avatar al.schwinn
Browse files

resolve possiblerelative pathes (can crash the codegen)

parent c80502d8
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,9 @@ function silecs_validate { ...@@ -73,6 +73,9 @@ function silecs_validate {
EXTENSION=$(echo "$FILE" | sed 's/^.*\.//') EXTENSION=$(echo "$FILE" | sed 's/^.*\.//')
# Resolve possible relative path
FILE=$(realpath "$FILE" )
case $EXTENSION in case $EXTENSION in
silecsdesign) silecsdesign)
SCHEMA=$SILECS_BASE/silecs-model/$SILECS_VERSION/xml/DesignSchema.xsd SCHEMA=$SILECS_BASE/silecs-model/$SILECS_VERSION/xml/DesignSchema.xsd
...@@ -151,6 +154,9 @@ function silecs_generate { ...@@ -151,6 +154,9 @@ function silecs_generate {
exit 1 exit 1
fi fi
# Resolve possible relative path
FILE=$(realpath "$FILE" )
EXTENSION=$(echo "$FILE" | sed 's/^.*\.//') EXTENSION=$(echo "$FILE" | sed 's/^.*\.//')
case $EXTENSION in case $EXTENSION in
...@@ -312,6 +318,9 @@ echo "created new silecsdeploy: $NEW_FILE" ...@@ -312,6 +318,9 @@ echo "created new silecsdeploy: $NEW_FILE"
function silecs_create { function silecs_create {
assert_n_arguments 2 assert_n_arguments 2
# Resolve possible relative path
FILE=$(realpath "$FILE" )
EXTENSION=$(echo "$FILE" | sed 's/^.*\.//') EXTENSION=$(echo "$FILE" | sed 's/^.*\.//')
FILE_PATH=$(dirname "$FILE") FILE_PATH=$(dirname "$FILE")
...@@ -336,6 +345,9 @@ function silecs_create { ...@@ -336,6 +345,9 @@ function silecs_create {
function silecs_open_diag { function silecs_open_diag {
assert_n_arguments 2 assert_n_arguments 2
# Resolve possible relative path
FILE=$(realpath "$FILE" )
EXTENSION=$(echo "$FILE" | sed 's/^.*\.//') EXTENSION=$(echo "$FILE" | sed 's/^.*\.//')
if [ $EXTENSION -ne "silecsdeploy"]; then if [ $EXTENSION -ne "silecsdeploy"]; then
echo "Error: diag tool only can be opened for a -silecsdeploy file" echo "Error: diag tool only can be opened for a -silecsdeploy file"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment