diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-09 06:46:43 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-09 06:46:43 -0500 |
commit | ac46df8daea09899ce30dc8fd70986e258c746bf (patch) | |
tree | 2750d3125fc253fd5b0671e4bd268eff1fd97296 /addon-sdk/source/bin/activate.ps1 | |
parent | 8cecf8d5208f3945b35f879bba3015bb1a11bec6 (diff) | |
download | UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.gz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.lz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.xz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.zip |
Move Add-on SDK source to toolkit/jetpack
Diffstat (limited to 'addon-sdk/source/bin/activate.ps1')
-rw-r--r-- | addon-sdk/source/bin/activate.ps1 | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/addon-sdk/source/bin/activate.ps1 b/addon-sdk/source/bin/activate.ps1 deleted file mode 100644 index 5d939d468..000000000 --- a/addon-sdk/source/bin/activate.ps1 +++ /dev/null @@ -1,99 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -$Env:VIRTUAL_ENV = (gl); -$Env:CUDDLEFISH_ROOT = $Env:VIRTUAL_ENV; - -# http://stackoverflow.com/questions/5648931/powershell-test-if-registry-value-exists/5652674#5652674 -Function Test-RegistryValue { - param( - [Alias("PSPath")] - [Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [String]$Path - , - [Parameter(Position = 1, Mandatory = $true)] - [String]$Name - , - [Switch]$PassThru - ) - - process { - if (Test-Path $Path) { - $Key = Get-Item -LiteralPath $Path - if ($Key.GetValue($Name, $null) -ne $null) { - if ($PassThru) { - Get-ItemProperty $Path $Name - } else { - $true - } - } else { - $false - } - } else { - $false - } - } -} - -$WINCURVERKEY = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion'; -$WIN64 = (Test-RegistryValue $WINCURVERKEY 'ProgramFilesDir (x86)'); - -if($WIN64) { - $PYTHONKEY='HKLM:SOFTWARE\Wow6432Node\Python\PythonCore'; -} -else { - $PYTHONKEY='HKLM:SOFTWARE\Python\PythonCore'; -} - -$Env:PYTHONVERSION = ''; -$Env:PYTHONINSTALL = ''; - -foreach ($version in @('2.6', '2.5', '2.4')) { - if (Test-RegistryValue "$PYTHONKEY\$version\InstallPath" '(default)') { - $Env:PYTHONVERSION = $version; - } -} - -if ($Env:PYTHONVERSION) { - $Env:PYTHONINSTALL = (Get-Item "$PYTHONKEY\$version\InstallPath)").'(default)'; -} - -if ($Env:PYTHONINSTALL) { - $Env:Path += ";$Env:PYTHONINSTALL"; -} - -if (Test-Path Env:_OLD_PYTHONPATH) { - $Env:PYTHONPATH = $Env:_OLD_PYTHONPATH; -} -else { - $Env:PYTHONPATH = ''; -} - -$Env:_OLD_PYTHONPATH=$Env:PYTHONPATH; -$Env:PYTHONPATH= "$Env:VIRTUAL_ENV\python-lib;$Env:PYTHONPATH"; - -if (Test-Path Function:_OLD_VIRTUAL_PROMPT) { - Set-Content Function:Prompt (Get-Content Function:_OLD_VIRTUAL_PROMPT); -} -else { - function global:_OLD_VIRTUAL_PROMPT {} -} - -Set-Content Function:_OLD_VIRTUAL_PROMPT (Get-Content Function:Prompt); - -function global:prompt { "($Env:VIRTUAL_ENV) $(_OLD_VIRTUAL_PROMPT)"; }; - -if (Test-Path Env:_OLD_VIRTUAL_PATH) { - $Env:PATH = $Env:_OLD_VIRTUAL_PATH; -} -else { - $Env:_OLD_VIRTUAL_PATH = $Env:PATH; -} - -$Env:Path="$Env:VIRTUAL_ENV\bin;$Env:Path" - -[System.Console]::WriteLine("Note: this PowerShell SDK activation script is experimental.") - -python -c "from jetpack_sdk_env import welcome; welcome()" - |