Skip to content

Commit

Permalink
Moved changephp to php-change
Browse files Browse the repository at this point in the history
* all other commands are in the same scope
  • Loading branch information
JeroenBoersma committed Sep 4, 2018
1 parent 0fd8c3d commit 6f54f79
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
34 changes: 1 addition & 33 deletions bin/dev_command/changephp
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@

echo 'PHP configured version '${DEV_PHP};
. ./php-change "$@";

local versions="`dc php_versions`" v='' version='' dir=${DEV_WORKSPACE_PATH};

if [ -z "$1" ]; then
exit 0;
fi

for v in ${versions}; do
if [ "$1" == "${v}" ]; then
version=${v};
fi
done

if [ -z "${version}" ]; then
echo 'Provide valid PHP version `dev changephp {VERSION}`';
echo ${versions};
exit 1;
fi

if [ "${version}" == "${DEV_PHP}" ]; then
exit 2;
fi

if [ -n "${DEV_PROJECTPATH}" ]; then
dir=${DEV_WORKSPACE_PATH}/DEV_PROJECTPATH};
fi

echo 'Update to '${version};

rm ${dir}/.php[1-9][0-9] >/dev/null 2>&1;
touch ${dir}/.${version};

exit 0;
36 changes: 36 additions & 0 deletions bin/dev_command/php-change
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

echo 'PHP configured version '${DEV_PHP};

local versions="`dc php_versions`" v='' version='' dir=${DEV_WORKSPACE_PATH};

if [ -z "$1" ]; then
exit 0;
fi

for v in ${versions}; do
if [ "$1" == "${v}" ]; then
version=${v};
fi
done

if [ -z "${version}" ]; then
echo 'Provide valid PHP version `dev changephp {VERSION}`';
echo ${versions};
exit 1;
fi

if [ "${version}" == "${DEV_PHP}" ]; then
exit 2;
fi

if [ -n "${DEV_PROJECTPATH}" ]; then
dir=${DEV_WORKSPACE_PATH}/${DEV_PROJECTPATH};
fi

echo 'Update to '${version};

rm ${dir}/.php[1-9][0-9] >/dev/null 2>&1;
touch ${dir}/.${version};

exit 0;

0 comments on commit 6f54f79

Please sign in to comment.