diff options
| author | Ângelo Andrade Cirino <[email protected]> | 2022-01-10 10:23:17 -0300 |
|---|---|---|
| committer | Ângelo Andrade Cirino <[email protected]> | 2022-01-10 10:23:17 -0300 |
| commit | ed0c0c5e0249aa966ea7061b30710abdd0b09d87 (patch) | |
| tree | 2a51c869a3aea1a093ed569e749bdf0465634a6c /scripts | |
| parent | 885d00da8caf74aeed758d030b9a1b50d9078e1f (diff) | |
| parent | 2431dd7e6142ff98b55741cfd4de4d2e69f4f8b5 (diff) | |
Merged from upstream/master
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/archlinux/PKGBUILD | 9 | ||||
| -rwxr-xr-x | scripts/get.ps1 | 13 | ||||
| -rwxr-xr-x | scripts/get.sh | 36 | ||||
| -rw-r--r-- | scripts/installer.nsi | 9 | ||||
| -rw-r--r-- | scripts/register-virtualenvs.sh | 72 | ||||
| -rw-r--r-- | scripts/rpmbuild/SPECS/xmake.spec | 26 | ||||
| -rwxr-xr-x | scripts/xrepo.bat | 52 | ||||
| -rw-r--r-- | scripts/xrepo.ps1 | 16 |
8 files changed, 194 insertions, 39 deletions
diff --git a/scripts/archlinux/PKGBUILD b/scripts/archlinux/PKGBUILD index 2d17c0dfe..445e51047 100755 --- a/scripts/archlinux/PKGBUILD +++ b/scripts/archlinux/PKGBUILD @@ -2,15 +2,16 @@ # PKGBuild Create By: lumpyzhu <[email protected]> pkgname=xmake -pkgver=2.3.2 +pkgver=2.5.9 pkgrel=1 -pkgdesc="A make-like build utility based on Lua" +pkgdesc="A cross-platform build utility based on Lua" +depends=('bash') arch=('i686' 'x86_64') url="https://github.com/xmake-io/xmake" license=('Apache') makedepends=() -source=("$pkgname.tar.gz::https://github.com/xmake-io/xmake/releases/download/v${pkgver}/xmake-v${pkgver}.tar.gz") -sha256sums=('b189074320ce1b215f85f8f20142fe173d981eb17c2c157f0fa6756fc00dac4e') +source=("https://github.com/xmake-io/xmake/releases/download/v${pkgver}/xmake-v${pkgver}.tar.gz") +sha256sums=('5b50e3f28956cabcaa153624c91781730387ceb7c056f3f9b5306b1c77460d8f') build() { cd "$srcdir" diff --git a/scripts/get.ps1 b/scripts/get.ps1 index 8cb27a888..538220acd 100755 --- a/scripts/get.ps1 +++ b/scripts/get.ps1 @@ -11,6 +11,7 @@ param ( ) & { + $LastRelease = "v2.6.2" $ErrorActionPreference = 'Stop' function writeErrorTip($msg) { @@ -30,9 +31,9 @@ param ( } if ($IsLinux -or $IsMacOS) { - writeErrorTip 'Install on *nix is not supported, try ' + writeErrorTip 'Install on *nix is not supported, try ' writeErrorTip '(Use curl) "bash <(curl -fsSL https://raw.githubusercontent.com/xmake-io/xmake/master/scripts/get.sh)"' - writeErrorTip 'or' + writeErrorTip 'or' writeErrorTip '(Use wget) "bash <(wget https://raw.githubusercontent.com/xmake-io/xmake/master/scripts/get.sh -O -)"' throw 'Unsupported platform' } @@ -90,7 +91,7 @@ param ( $url = if ($v -is [version]) { "https://github.com/xmake-io/xmake/releases/download/v$v/xmake-v$v.$winarch.exe" } else { - "https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=$v&pr=false&job=Image%3A+Visual+Studio+2017%3B+Platform%3A+$arch" + "https://github.com/xmake-io/xmake/releases/download/$LastRelease/xmake-$v.$winarch.exe" } Write-Host "Start downloading $url .." try { @@ -145,9 +146,9 @@ param ( writeErrorTip "Please try again as administrator" return } - + if ($content) { - $content = [System.Text.RegularExpressions.Regex]::Replace($content, "\n*(# PowerShell parameter completion shim for xmake)?\s*Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock\s*{.+?\n}\s*", "`n", [System.Text.RegularExpressions.RegexOptions]::Singleline) + $content = [System.Text.RegularExpressions.Regex]::Replace($content, "\n*(# PowerShell parameter completion shim for xmake)?\s*Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock\s*{.+?\n}\s*", "`n", [System.Text.RegularExpressions.RegexOptions]::Singleline) } try { $appendcontent = (Invoke-Webrequest 'https://xmake.io/assets/scripts/pscompletions.text' -UseBasicParsing).Content @@ -156,7 +157,7 @@ param ( writeErrorTip 'Check your network or... the news of S3 break' return } - Set-Content $file "$content`n$appendcontent" -NoNewline + Set-Content $file "$content`n# >>> xmake >>>`n$appendcontent`n# <<< xmake <<<`n" -NoNewline . $file Write-Host "Tab completion installed" } diff --git a/scripts/get.sh b/scripts/get.sh index 8363b4499..ca009407d 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -40,7 +40,7 @@ remote_get_content() { if curl --version >/dev/null 2>&1 then curl -fSL "$1" - elif wget --version >/dev/null 2>&1 + elif wget --version >/dev/null 2>&1 || wget --help >/dev/null 2>&1 then wget "$1" -O - fi @@ -133,32 +133,35 @@ my_exit(){ } test_tools() { - prog='#include <stdio.h>\n#include <readline/readline.h>\nint main(){readline(0);return 0;}' + prog='#include <stdio.h>\nint main(){return 0;}' { git --version && $make --version && { - echo -e "$prog" | cc -xc - -o /dev/null -lreadline || - echo -e "$prog" | gcc -xc - -o /dev/null -lreadline || - echo -e "$prog" | clang -xc - -o /dev/null -lreadline || - echo -e "$prog" | cc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || - echo -e "$prog" | gcc -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline || - echo -e "$prog" | clang -xc - -o /dev/null -I/usr/local/include -L/usr/local/lib -lreadline + echo -e "$prog" | cc -xc - -o /dev/null || + echo -e "$prog" | gcc -xc - -o /dev/null || + echo -e "$prog" | clang -xc - -o /dev/null || + echo -e "$prog" | cc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include || + echo -e "$prog" | gcc -xc -c - -o /dev/null -I/usr/include -I/usr/local/include || + echo -e "$prog" | clang -xc -c - -o /dev/null -I/usr/include -I/usr/local/include } } >/dev/null 2>&1 } install_tools() { { apt --version >/dev/null 2>&1 && $sudoprefix apt install -y git build-essential libreadline-dev ccache; } || - { yum --version >/dev/null 2>&1 && $sudoprefix yum install -y git readline-devel ccache && $sudoprefix yum groupinstall -y 'Development Tools'; } || + { yum --version >/dev/null 2>&1 && $sudoprefix yum install -y git readline-devel ccache bzip2 && $sudoprefix yum groupinstall -y 'Development Tools'; } || { zypper --version >/dev/null 2>&1 && $sudoprefix zypper --non-interactive install git readline-devel ccache && $sudoprefix zypper --non-interactive install -t pattern devel_C_C++; } || { pacman -V >/dev/null 2>&1 && $sudoprefix pacman -S --noconfirm --needed git base-devel ccache; } || { emerge -V >/dev/null 2>&1 && $sudoprefix emerge -atv dev-vcs/git ccache; } || { pkg list-installed >/dev/null 2>&1 && $sudoprefix pkg install -y git getconf build-essential readline ccache; } || # termux { pkg help >/dev/null 2>&1 && $sudoprefix pkg install -y git readline ccache ncurses; } || # freebsd - { apk --version >/dev/null 2>&1 && $sudoprefix apk add git gcc g++ make readline-dev ncurses-dev libc-dev linux-headers; } + { nix-env --version >/dev/null 2>&1 && nix-env -i git gcc readline ncurses; } || # nixos + { apk --version >/dev/null 2>&1 && $sudoprefix apk add git gcc g++ make readline-dev ncurses-dev libc-dev linux-headers; } || + { xbps-install --version >/dev/null 2>&1 && $sudoprefix xbps-install -Sy git base-devel ccache; } #void + } -test_tools || { install_tools && test_tools; } || my_exit "$(echo -e 'Dependencies Installation Fail\nThe getter currently only support these package managers\n\t* apt\n\t* yum\n\t* zypper\n\t* pacman\n\t* portage\nPlease install following dependencies manually:\n\t* git\n\t* build essential like `make`, `gcc`, etc\n\t* libreadline-dev (readline-devel)\n\t* ccache (optional)')" 1 +test_tools || { install_tools && test_tools; } || my_exit "$(echo -e 'Dependencies Installation Fail\nThe getter currently only support these package managers\n\t* apt\n\t* yum\n\t* zypper\n\t* pacman\n\t* portage\n\t* xbps\n Please install following dependencies manually:\n\t* git\n\t* build essential like `make`, `gcc`, etc\n\t* libreadline-dev (readline-devel)\n\t* ccache (optional)')" 1 projectdir=$tmpdir if [ 'x__local__' = "x$branch" ]; then if [ -d '.git' ]; then @@ -222,18 +225,25 @@ else fi write_profile() { - grep -sq ".xmake/profile" $1 || echo -e "\n[[ -s \"\$HOME/.xmake/profile\" ]] && source \"\$HOME/.xmake/profile\" # load xmake profile" >> $1 + grep -sq ".xmake/profile" $1 || echo -e "\n# >>> xmake >>>\n[[ -s \"\$HOME/.xmake/profile\" ]] && source \"\$HOME/.xmake/profile\" # load xmake profile\n# <<< xmake <<<" >> $1 } install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export PATH=$prefix/bin:\$PATH" > ~/.xmake/profile + echo "export XMAKE_ROOTDIR=\"$prefix/bin\"" > ~/.xmake/profile + echo 'export PATH="$XMAKE_ROOTDIR:$PATH"' >> ~/.xmake/profile if [ -f "$projectdir/scripts/register-completions.sh" ]; then cat "$projectdir/scripts/register-completions.sh" >> ~/.xmake/profile else remote_get_content "$gitrepo_raw/scripts/register-completions.sh" >> ~/.xmake/profile fi + if [ -f "$projectdir/scripts/register-virtualenvs.sh" ]; then + cat "$projectdir/scripts/register-virtualenvs.sh" >> ~/.xmake/profile + else + remote_get_content "$gitrepo_raw/scripts/register-virtualenvs.sh" >> ~/.xmake/profile + fi + if [[ "$SHELL" = */zsh ]]; then write_profile ~/.zshrc elif [[ "$SHELL" = */ksh ]]; then diff --git a/scripts/installer.nsi b/scripts/installer.nsi index a01b6feea..8ef9e2e6d 100644 --- a/scripts/installer.nsi +++ b/scripts/installer.nsi @@ -230,7 +230,12 @@ Section "XMake (required)" InstallExeutable SetOutPath $InstDir ; Remove previous directories used - RMDir /r "$InstDir" + ; https://github.com/xmake-io/xmake/issues/1888 + IfFileExists "$InstDir\xmake.exe" file_found file_not_found_or_end + file_found: + RMDir /r "$InstDir" + goto file_not_found_or_end + file_not_found_or_end: ; Put file there File /r /x ".DS_Store" /x "*.swp" "..\xmake\*.*" @@ -248,7 +253,7 @@ Section "XMake (required)" InstallExeutable WriteRegStr ${RootKey} ${RegUninstall} "NoAdmin" "$NOADMIN" ; Write the uninstall keys for Windows - WriteRegStr ${RootKey} ${RegUninstall} "DisplayName" "XMake build utility" + WriteRegStr ${RootKey} ${RegUninstall} "DisplayName" "XMake build utility (${ARCH})" WriteRegStr ${RootKey} ${RegUninstall} "DisplayIcon" '"$InstDir\xmake.exe"' WriteRegStr ${RootKey} ${RegUninstall} "Comments" "A cross-platform build utility based on Lua" WriteRegStr ${RootKey} ${RegUninstall} "Publisher" "The TBOOX Open Source Group" diff --git a/scripts/register-virtualenvs.sh b/scripts/register-virtualenvs.sh new file mode 100644 index 000000000..6b0c25160 --- /dev/null +++ b/scripts/register-virtualenvs.sh @@ -0,0 +1,72 @@ + +# virtual environments for *nix shell + +if test "${XMAKE_ROOTDIR}"; then + export XMAKE_EXE=${XMAKE_ROOTDIR}/xmake +else + export XMAKE_EXE=xmake +fi + +function xrepo { + if [ $# -ge 2 ] && [ "$1" = "env" ]; then + local cmd="${2-x}" + case "$cmd" in + shell) + if test "${XMAKE_PROMPT_BACKUP}"; then + PS1="${XMAKE_PROMPT_BACKUP}" + source "${XMAKE_ENV_BACKUP}" || return 1 + unset XMAKE_PROMPT_BACKUP + unset XMAKE_ENV_BACKUP + fi + "$XMAKE_EXE" lua private.xrepo.action.env.info config || return 1 + local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt)" || return 1 + if [ -z "${prompt+x}" ]; then + return 1 + fi + local activateCommand="$("$XMAKE_EXE" lua private.xrepo.action.env.info script.bash)" || return 1 + export XMAKE_ENV_BACKUP="$("$XMAKE_EXE" lua private.xrepo.action.env.info envfile)" + export XMAKE_PROMPT_BACKUP="${PS1}" + "$XMAKE_EXE" lua private.xrepo.action.env.info backup.bash 1>"$XMAKE_ENV_BACKUP" + eval "$activateCommand" + PS1="${prompt} $PS1" + ;; + quit) + if test "${XMAKE_PROMPT_BACKUP}"; then + PS1="${XMAKE_PROMPT_BACKUP}" + source "${XMAKE_ENV_BACKUP}" || return 1 + unset XMAKE_PROMPT_BACKUP + unset XMAKE_ENV_BACKUP + fi + ;; + -b|--bind) + if [ "$4" = "shell" ]; then + local bnd="${3-x}" + if test "${XMAKE_PROMPT_BACKUP}"; then + PS1="${XMAKE_PROMPT_BACKUP}" + source "${XMAKE_ENV_BACKUP}" || return 1 + unset XMAKE_PROMPT_BACKUP + unset XMAKE_ENV_BACKUP + fi + "$XMAKE_EXE" lua private.xrepo.action.env.info config $bnd || return 1 + local prompt="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info prompt $bnd)" || return 1 + if [ -z "${prompt+x}" ]; then + return 1 + fi + local activateCommand="$("$XMAKE_EXE" lua --quiet private.xrepo.action.env.info script.bash $bnd)" || return 1 + export XMAKE_ENV_BACKUP="$("$XMAKE_EXE" lua private.xrepo.action.env.info envfile $bnd)" + export XMAKE_PROMPT_BACKUP="${PS1}" + "$XMAKE_EXE" lua --quiet private.xrepo.action.env.info backup.bash $bnd 1>"$XMAKE_ENV_BACKUP" + eval "$activateCommand" + PS1="${prompt} $PS1" + else + "$XMAKE_EXE" lua private.xrepo "$@" + fi + ;; + *) + "$XMAKE_EXE" lua private.xrepo "$@" + ;; + esac + else + "$XMAKE_EXE" lua private.xrepo "$@" + fi +} diff --git a/scripts/rpmbuild/SPECS/xmake.spec b/scripts/rpmbuild/SPECS/xmake.spec index 7c7d5ed38..3485dc68a 100644 --- a/scripts/rpmbuild/SPECS/xmake.spec +++ b/scripts/rpmbuild/SPECS/xmake.spec @@ -1,13 +1,14 @@ -%define xmake_revision fd248b8b97f62762ce6ea6e0008b4367bef29d4d -%define tbox_revision 5ef932750ede0b90867fd4afdcf1deed2464c82b -%define sv_revision 9a3cf7c8e589de4f70378824329882c4a047fffc +%define xmake_revision 022ca13475739cee7e10bd0a3256ecd704fb2e6d +%define tbox_revision 122a479e626ee3fdd7d6c1117ec7c19212a1e087 +%define sv_revision 035262773da0500367cb88e6f30197908159a348 %define lua_cjson_revision 515bab6d6d80b164b94db73af69609ea02f3a798 %define luajit_revision e9af1abec542e6f9851ff2368e7f196b6382a44c +%define lua_revision eadd8c7178c79c814ecca9652973a9b9dd4cc71b %define _binaries_in_noarch_packages_terminate_build 0 %undefine _disable_source_fetch Name: xmake -Version: 2.5.6 +Version: 2.6.2 Release: 1%{?dist} Summary: A cross-platform build utility based on Lua BuildArch: noarch @@ -15,9 +16,10 @@ License: ASL 2.0 URL: https://xmake.io Source0: https://github.com/xmake-io/xmake/archive/%{xmake_revision}.tar.gz#/xmake-%{xmake_revision}.tar.gz Source1: https://github.com/tboox/tbox/archive/%{tbox_revision}.tar.gz#/tbox-%{tbox_revision}.tar.gz -Source2: https://github.com/xmake-io/xmake-core-luajit/archive/%{luajit_revision}.tar.gz#/xmake-core-luajit-%{luajit_revision}.tar.gz -Source3: https://github.com/xmake-io/xmake-core-sv/archive/%{sv_revision}.tar.gz#/xmake-core-sv-%{sv_revision}.tar.gz -Source4: https://github.com/xmake-io/xmake-core-lua-cjson/archive/%{lua_cjson_revision}.tar.gz#/xmake-core-lua-cjson-%{lua_cjson_revision}.tar.gz +Source2: https://github.com/xmake-io/xmake-core-lua/archive/%{lua_revision}.tar.gz#/xmake-core-lua-%{lua_revision}.tar.gz +Source3: https://github.com/xmake-io/xmake-core-luajit/archive/%{luajit_revision}.tar.gz#/xmake-core-luajit-%{luajit_revision}.tar.gz +Source4: https://github.com/xmake-io/xmake-core-sv/archive/%{sv_revision}.tar.gz#/xmake-core-sv-%{sv_revision}.tar.gz +Source5: https://github.com/xmake-io/xmake-core-lua-cjson/archive/%{lua_cjson_revision}.tar.gz#/xmake-core-lua-cjson-%{lua_cjson_revision}.tar.gz BuildRequires: gcc-c++ BuildRequires: ncurses-devel @@ -38,19 +40,23 @@ system to help users solve the integrated use of C/C++ dependent libraries. %prep %setup -q -T -b 1 -n tbox-%{tbox_revision} cd .. -%setup -q -T -b 2 -n xmake-core-luajit-%{luajit_revision} +%setup -q -T -b 2 -n xmake-core-lua-%{lua_revision} cd .. -%setup -q -T -b 3 -n xmake-core-sv-%{sv_revision} +%setup -q -T -b 3 -n xmake-core-luajit-%{luajit_revision} cd .. -%setup -q -T -b 4 -n xmake-core-lua-cjson-%{lua_cjson_revision} +%setup -q -T -b 4 -n xmake-core-sv-%{sv_revision} +cd .. +%setup -q -T -b 5 -n xmake-core-lua-cjson-%{lua_cjson_revision} cd .. %setup -q -T -b 0 -n xmake-%{xmake_revision} rm -rf core/src/sv/sv rm -rf core/src/tbox/tbox +rm -rf core/src/lua/lua rm -rf core/src/luajit/luajit rm -rf core/src/lua-cjson/lua-cjson ln -s `pwd`/../tbox-%{tbox_revision} core/src/tbox/tbox ln -s `pwd`/../xmake-core-sv-%{sv_revision} core/src/sv/sv +ln -s `pwd`/../xmake-core-lua-%{lua_revision} core/src/lua/lua ln -s `pwd`/../xmake-core-luajit-%{luajit_revision} core/src/luajit/luajit ln -s `pwd`/../xmake-core-lua-cjson-%{lua_cjson_revision} core/src/lua-cjson/lua-cjson diff --git a/scripts/xrepo.bat b/scripts/xrepo.bat index c8714a11c..0416d4a10 100755 --- a/scripts/xrepo.bat +++ b/scripts/xrepo.bat @@ -22,7 +22,7 @@ if !errorlevel! neq 0 ( exit /B !errorlevel! ) - @%XMAKE_EXE% lua private.xrepo.action.env.info prompt 1>nul + @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt 1>nul if !errorlevel! neq 0 ( echo error: xmake.lua not found^^! exit /B !errorlevel! @@ -39,13 +39,13 @@ if !errorlevel! neq 0 ( exit /B !errorlevel! ) - @%XMAKE_EXE% lua private.xrepo.action.env.info prompt 1>nul + @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt 1>nul if !errorlevel! neq 0 ( echo error: xmake.lua not found^^! exit /B !errorlevel! ) endlocal - for /f %%i in ('@%XMAKE_EXE% lua private.xrepo.action.env.info prompt') do @( + for /f %%i in ('@%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt') do @( @set "PROMPT=%%i %PROMPT%" ) @set XMAKE_PROMPT_BACKUP=%PROMPT% @@ -60,6 +60,52 @@ ) goto :ENDXREPO ) + set XREPO_BIND_FLAG= + if [%2]==[-b] if [%4]==[shell] ( + set XREPO_BIND_FLAG=1 + ) + if [%2]==[--bind] if [%4]==[shell] ( + set XREPO_BIND_FLAG=1 + ) + if defined XREPO_BIND_FLAG ( + set XREPO_BIND_FLAG= + if defined XMAKE_PROMPT_BACKUP ( + call %XMAKE_ENV_BACKUP% + setlocal EnableDelayedExpansion + if !errorlevel! neq 0 exit /B !errorlevel! + endlocal + set PROMPT=%XMAKE_PROMPT_BACKUP% + set XMAKE_ENV_BACKUP= + set XMAKE_PROMPT_BACKUP= + echo Please rerun `xrepo env shell` to enter the environment. + exit /B 1 + ) else ( + setlocal EnableDelayedExpansion + %XMAKE_EXE% lua private.xrepo.action.env.info config %3 + if !errorlevel! neq 0 ( + exit /B !errorlevel! + ) + @%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt %3 1>nul + if !errorlevel! neq 0 ( + echo error: environment not found^^! + exit /B !errorlevel! + ) + endlocal + for /f %%i in ('@%XMAKE_EXE% lua --quiet private.xrepo.action.env.info prompt %3') do @( + @set "PROMPT=%%i %PROMPT%" + ) + @set XMAKE_PROMPT_BACKUP=%PROMPT% + ) + for /f %%i in ('@%XMAKE_EXE% lua private.xrepo.action.env.info envfile %3') do @( + @set "XMAKE_ENV_BACKUP=%%i.bat" + @"%XMAKE_EXE%" lua --quiet private.xrepo.action.env.info backup.cmd %3 1>"%%i.bat" + ) + for /f %%i in ('@%XMAKE_EXE% lua private.xrepo.action.env.info envfile %3') do @( + @"%XMAKE_EXE%" lua --quiet private.xrepo.action.env.info script.cmd %3 1>"%%i.bat" + call "%%i.bat" + ) + goto :ENDXREPO + ) ) @call %XMAKE_EXE% lua private.xrepo %* diff --git a/scripts/xrepo.ps1 b/scripts/xrepo.ps1 index a821d8057..74e5e4682 100644 --- a/scripts/xrepo.ps1 +++ b/scripts/xrepo.ps1 @@ -19,13 +19,27 @@ if ($Args.Count -eq 0) { if ((Test-Path 'Env:XMAKE_PROMPT_MODIFIER') -and ($Env:XMAKE_PROMPT_MODIFIER -ne "")) { Exit-XrepoEnvironment; } - Enter-XrepoEnvironment; + Enter-XrepoEnvironment $Null; return; } "quit" { Exit-XrepoEnvironment; return; } + {$_ -in "-b", "--bind"} { + if (($Args.Count -ge 4) -and ($Args[3] -eq "shell")) { + if (-not (Test-Path 'Env:XMAKE_ROOTDIR')) { + $Env:XMAKE_ROOTDIR = $BASE_DIR; + Import-Module "$Env:XMAKE_ROOTDIR\scripts\xrepo-hook.psm1"; + Add-XrepoEnvironmentToPrompt; + } + if ((Test-Path 'Env:XMAKE_PROMPT_MODIFIER') -and ($Env:XMAKE_PROMPT_MODIFIER -ne "")) { + Exit-XrepoEnvironment; + } + Enter-XrepoEnvironment $Args[2]; + return; + } + } } } |
