mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
refactor(.scripts): cleanup sh (#252)
- proper escaping - use `!#/usr/bin/env sh` for broader compliance
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
# Note: Script must be run like this `. .init_env.sh` to setup variables for your current shell
|
||||
# define relative paths
|
||||
|
||||
DistPath="tauri/test/fixture/dist"
|
||||
SrcPath="tauri/test/fixture/src-tauri"
|
||||
DistPath='tauri/test/fixture/dist'
|
||||
SrcPath='tauri/test/fixture/src-tauri'
|
||||
|
||||
echo "Setting up enviromental Variables"
|
||||
echo "Setting up enviroment Variables"
|
||||
|
||||
# check if relative paths exist
|
||||
if [ -d "$DistPath" ]||[ -d "$SrcPath" ]
|
||||
if [ -d "${DistPath}" ]||[ -d "${SrcPath}" ]
|
||||
then
|
||||
# Convert to absolute paths
|
||||
DistPath="$(cd "$DistPath" && pwd -P)"
|
||||
SrcPath="$(cd "$SrcPath" && pwd -P)"
|
||||
DistPath="$(cd "${DistPath}" && pwd -P)"
|
||||
SrcPath="$(cd "${SrcPath}" && pwd -P)"
|
||||
|
||||
# export enviromental variables
|
||||
export TAURI_DIST_DIR=$DistPath
|
||||
export TAURI_DIR=$SrcPath
|
||||
export TAURI_DIST_DIR=${DistPath}
|
||||
export TAURI_DIR=${SrcPath}
|
||||
echo "Variables set, ready to work!"
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user