view deploy/win/zip.ps1 @ 399:a3912193ce69 tip

Default branch is now named default on git as well as hg, in case we ever want to switch to mirroring in the other direction
author Chris Cannam
date Thu, 27 Aug 2020 15:57:37 +0100
parents 0a45b9debc30
children
line wrap: on
line source

Set-StrictMode -Version 2.0
$ErrorActionPreference = "Stop"

Add-Type -assembly "system.io.compression.filesystem"

if ($args.length -ne 2) {
    echo "Usage: zip target.zip sourcedir"
    exit 2
}

$sourcename = $args[1]
$targetname = $args[0]

$source = (Resolve-Path $sourcename)

if ([System.IO.Path]::IsPathRooted($targetname)) {
   $target = $targetname
} else {
   $target = "$pwd\$targetname"
}

echo "Compressing from $source to $target..." | Out-Host
 
[io.compression.zipfile]::CreateFromDirectory($source, $target)