Skip to content

Commit

Permalink
ESDEV-4368 Unify execution of readlink and tr
Browse files Browse the repository at this point in the history
The commands `readlink` and `tr` behaves differently on different
operating systems. In order to unify behavior PHP will be used
instead.
  • Loading branch information
rezonanc-oxid committed Mar 23, 2017
1 parent ebc6457 commit c143bdd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions oe-eshop-facts_helper
Expand Up @@ -3,7 +3,7 @@
function get_full_path_name {
local PARTIAL_PATH="$1"

readlink -fn "$PARTIAL_PATH"
echo `${ESHOP_PHP_BIN_PATH} -r "echo realpath(\"$PARTIAL_PATH\");"`
}

function get_existing_full_path_name {
Expand All @@ -22,10 +22,8 @@ function get_current_script_path {
function get_vendor_name {
local SOURCE="$1"
local FULL_PATH=$(get_current_script_path "$SOURCE")
local LIST=($(echo $FULL_PATH | tr "/" "\n"))
local VENDOR_NAME=${LIST[-3]}

echo ${VENDOR_NAME:-oxid-esales}
echo `${ESHOP_PHP_BIN_PATH} -r "echo array_slice(explode(\"/\", \"$FULL_PATH\"), -3)[0] ?: \"oxid-esales\";"`
}

function print_variables_header {
Expand Down

0 comments on commit c143bdd

Please sign in to comment.