-
Notifications
You must be signed in to change notification settings - Fork 0
/
ovum.ps1
34 lines (27 loc) · 954 Bytes
/
ovum.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
if ($args.Count -ne 2)
{
Write-Host "Usage: ovum.ps1 lang projectdir"
break
}
$ErrorActionPreference='Stop'
$parent = $args[0]
$womb = $args[1]
$ovary = "$env:temp\" + [System.IO.Path]::GetRandomFileName()
Write-Host "working in $ovary"
New-Item "$ovary" -type directory | Out-Null
if (!(Test-Path "$womb")) {
New-Item "$womb" -type directory | Out-Null
}
Write-Host "downloading seed..."
(new-object System.Net.WebClient).DownloadFile("https://github.com/scarytom/ovum/archive/$parent.zip","$ovary\data.zip")
Write-Host "germinating seed..."
$shell_app=new-object -com shell.application
$zip_file = $shell_app.namespace("$ovary\data.zip")
$destination = $shell_app.namespace("$ovary")
$destination.Copyhere($zip_file.items(), 0x4)
Write-Host "removing husk..."
Remove-Item "$ovary\data.zip"
Write-Host "planting seed..."
Move-Item "$ovary\*\*" "$womb\" -ErrorAction SilentlyContinue
Write-Host "tidying up..."
Remove-Item "$ovary" -recurse