[haxe] add activate script

This commit is contained in:
2018-10-12 14:58:47 +03:00
parent 04dae41e2c
commit 0694b624be
3 changed files with 73 additions and 2 deletions

View File

@@ -56,7 +56,9 @@ class Haxe extends Sdk {
}
prepare() {
return Promise.all([this.neko.prepare(), super.prepare()]);
return Promise.all([this.neko.prepare(), super.prepare()]).then(() => {
fs.copyFileSync(path.resolve(__dirname, '..', 'template/activate'), path.resolve(this.path, 'activate'));
});
}
get link() {

View File

@@ -1,6 +1,6 @@
{
"name": "gulp-haxetool",
"version": "0.0.13",
"version": "0.0.14",
"description": "HaXe Tool for Gulp",
"main": "index.js",
"dependencies": {

69
template/activate Normal file
View File

@@ -0,0 +1,69 @@
# From python venv activate
deactivate () {
# reset old environment variables
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if ! [ -z "${_OLD_VIRTUAL_LD_LIBRARY_PATH+_}" ] ; then
LD_LIBRARY_PATH="$_OLD_VIRTUAL_LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
unset _OLD_VIRTUAL_LD_LIBRARY_PATH
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset HAXE_HOME
if [ ! "${1-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
HAXE_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
export HAXE_HOME
HAXE_STD_PATH="${HAXE_HOME}/std"
export HAXE_STD_PATH
_OLD_VIRTUAL_PATH="$PATH"
PATH="${PATH}:${HAXE_HOME}"
export PATH
_OLD_VIRTUAL_LD_LIBRARY_PATH="$PATH"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${HAXE_HOME}"
export LD_LIBRARY_PATH
if [ -z "${HAXE_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
if [ "x" != x ] ; then
PS1="$PS1"
else
PS1="(haxe) $PS1"
fi
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi