"Fossies" - the Fresh Open Source Software Archive

Member "cutter-1.8.2/scripts/bundle_python.ps1" (20 May 2019, 925 Bytes) of package /linux/privat/cutter-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Microsoft PowerShell source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 $arch = $args[0]
    2 $dist = $args[1]
    3 
    4 $py_version = (python --version).Split()[1]
    5 $py_base = "python" + $py_version[0] + $py_version[2]
    6 $py_platform = If ($arch -eq "x64") {"amd64"} Else {"win32"}
    7 $py_url = "https://www.python.org/ftp/python/${py_version}/python-${py_version}-embed-${py_platform}.zip"
    8 
    9 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget ${py_url} -OutFile python_embed.zip; Expand-Archive .\python_embed.zip -DestinationPath .\python_embed
   10 New-Item -ItemType directory -Force -Path $dist\$py_base
   11 Copy-Item .\python_embed\${py_base}.zip -Destination $dist\$py_base
   12 Copy-Item .\python_embed\*.pyd -Destination $dist\$py_base
   13 Copy-Item .\python_embed\sqlite3.dll -Destination $dist\$py_base
   14 Copy-Item .\python_embed\python*.dll -Destination $dist
   15 [System.IO.File]::WriteAllLines("${dist}\${py_base}._pth", "${py_base}`r`n${py_base}\${py_base}.zip`r`n${py_base}\site-packages")