Skip to content

Commit 05a2c3c

Browse files
committed
now thats what I call CI
1 parent eaf84d2 commit 05a2c3c

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ docs/_site/
1919
# IDE stuff
2020
*.sublime-*
2121
*.code-workspace
22+
.vscode

makeGSM.ps1

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<# PS script to use with the pucelle.run-and-save Plugin for VSC #>
2+
<# Put the following into your *.code-workspace file:
3+
"settings": {
4+
"runOnSave.commands": [
5+
{
6+
"match": "\\.gdl$",
7+
"command": "Powershell.exe -File ${workspaceFolder}\\makeGSM.ps1 ${file}",
8+
"runIn": "terminal",
9+
"runningStatusMessage": "LP_XMLConverter"
10+
}
11+
]
12+
}
13+
#>
14+
param (
15+
[string] $source,
16+
[string] $dest = $null
17+
)
18+
19+
$AC_VER = "24"
20+
$LPXCONV_PATH = "C:/Program Files/GRAPHISOFT/ARCHICAD $AC_VER/LP_XMLConverter.exe"
21+
$COMM = "hsf2libpart"
22+
23+
# $source is a path to a GDL file
24+
$source_base = Split-Path -Path $source | Split-Path
25+
# went two folders up
26+
$main_name = Split-Path -Path $source_base -Leaf
27+
28+
if ($dest -eq "") {
29+
$dest = $source_base + ".gsm"
30+
}
31+
32+
# write-host $source_base
33+
# write-host $dest
34+
35+
# -NoNewWindow will not spawn a new terminal but use the VSC one instead
36+
# and a stupid trick:
37+
# those weirdos @MS didn't thought of spaces, so we do have to
38+
# with ridiculous triple quotes
39+
Start-Process -NoNewWindow -FilePath "`"$LPXCONV_PATH`"" -ArgumentList $COMM, "`"$source_base`"", "`"$dest`""
40+
41+
# write-host "Finished."

0 commit comments

Comments
 (0)