-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch_bin.cmd
52 lines (42 loc) · 1.29 KB
/
fetch_bin.cmd
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
@echo off
rem ---------------------------------------------------------------------------------
rem
rem Distributed under MIT Licence
rem See https://github.com/house-of-abbey/scratch_vhdl/blob/main/LICENCE.
rem
rem J D Abbey & P A Abbey, 15 October 2022
rem
rem ---------------------------------------------------------------------------------
title Fetching Binaries
rem Batch file's directory where the source code is
set SRC=%~dp0
rem drop last character '\'
set SRC=%SRC:~0,-1%
rem Assumes 'C:\Windows\System32' is on the PATH
if exist %SRC%\bin (
echo Deleting old bin downloads
pushd %SRC%\bin
for %%F IN (customasm customasm.exe customasm.html default_text_override.js) do (
if exist %%F ( del /f %%F )
)
popd
) else (
mkdir %SRC%\bin
)
curl ^
--silent ^
--location ^
--output %TEMP%\customasm.zip ^
https://github.com/josephabbey/customasm/releases/latest/download/customasm.zip
tar ^
-C %SRC%\bin ^
-xf %TEMP%\customasm.zip
set ASM=%SRC%\design\demos\asm\ruledef.asm
set DEST=%SRC%\bin\default_text_override.js
echo|set /p="window.default_text_override=`" > %DEST%
powershell -Command "(Get-Content %ASM%) -replace '`', '\`' | Out-File -encoding ASCII -Append %DEST%"
echo `>> %DEST%
del /f %TEMP%\customasm.zip
echo Contents of '%SRC%\bin':
dir /b %SRC%\bin
pause