-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.ps1
59 lines (52 loc) · 1.31 KB
/
make.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$ErrorActionPreference = "Stop"
function rmrf($file) {
if (Test-Path "$file") {
Remove-Item -Recursive -Force "$file"
}
}
function install {
$installDirectory = "$env:ProgramFiles\Lumpy"
New-Item -Type Directory -Force "$installDirectory"
New-Item -Type Directory -Force "$installDirectory\bin"
New-Item -Type Directory -Force "$installDirectory\lib"
Copy-Item -Force lumpy.py "$installDirectory\lumpy.py"
Copy-Item -Force bin\lumpy-test.py "$installDirectory\bin\lumpy-test.py"
Copy-Item -Force -Recurse lib\* "$installDirectory\lib\"
}
function check {
python bin\lumpy-test.py
}
function lint {
python -m mypy --check-untyped-defs lumpy.py bin\lumpy-test.py
python -m flake8 --ignore=E203,E221,E241,E501,W503 lumpy.py bin\lumpy-test.py
}
function format {
python -m black --line-length=79 lumpy.py bin\lumpy-test.py
}
function clean {
rmrf .lumpy-history
rmrf __pycache__
rmrf .mypy_cache
}
foreach ($item in $Args) {
switch ($item) {
"install" {
install
}
"check" {
check
}
"lint" {
lint
}
"format" {
format
}
"clean" {
clean
}
Default {
throw "unrecognized target '$item'"
}
}
}