mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 09:39:51 +00:00
chore(windows): remove .bat cruft
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
setlocal
|
||||
@echo off
|
||||
pushd "%userprofile%" || goto :error
|
||||
IF NOT EXIST .local (
|
||||
mkdir .local || goto :error
|
||||
)
|
||||
IF NOT EXIST .local\bin (
|
||||
mkdir .local\bin || goto :error
|
||||
)
|
||||
|
||||
rem {{ baseurl }}
|
||||
rem {{ version }}
|
||||
pushd .local\bin || goto :error
|
||||
if NOT EXIST webi.bat (
|
||||
rem without SilentlyContinue this is SLOOOOOOOOOOOOOOOW!
|
||||
powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://webinstall.dev/packages/_webi/webi.bat -OutFile webi.bat || goto :error
|
||||
)
|
||||
call .\webi {{ exename }} || goto :error
|
||||
rem pathman add "%userprofile%\.local\bin" >nul 2>&1 || goto :error
|
||||
pathman add "%userprofile%\.local\bin" || goto :error
|
||||
popd || goto :error
|
||||
popd
|
||||
|
||||
goto :EOF
|
||||
|
||||
:error
|
||||
echo Failed with error #%errorlevel%.
|
||||
exit /b %errorlevel%
|
||||
@@ -156,46 +156,6 @@ Releases.renderBash = async function (
|
||||
});
|
||||
};
|
||||
|
||||
Releases.renderBatch = async function (
|
||||
pkgdir,
|
||||
rel,
|
||||
{ baseurl, pkg, tag, ver, os, arch, formats },
|
||||
) {
|
||||
if (!Array.isArray(formats)) {
|
||||
formats = [];
|
||||
}
|
||||
if (!tag) {
|
||||
tag = '';
|
||||
}
|
||||
return fs.promises
|
||||
.readFile(path.join(pkgdir, 'install.bat'), 'utf8')
|
||||
.then(function (installTxt) {
|
||||
installTxt = padScript(installTxt);
|
||||
/*
|
||||
var vers = rel.version.split('.');
|
||||
var v = {
|
||||
major: vers.shift() || '',
|
||||
minor: vers.shift() || '',
|
||||
patch: vers.join('.').replace(/[+\-].*$/, ''),
|
||||
build: vers
|
||||
.join('.')
|
||||
.replace(/[^+\-]*()/, '')
|
||||
.replace(/^-/, '')
|
||||
};
|
||||
*/
|
||||
return fs.promises
|
||||
.readFile(path.join(__dirname, 'template.bat'), 'utf8')
|
||||
.then(function (tplTxt) {
|
||||
return tplTxt
|
||||
.replace(
|
||||
/^(REM )?WEBI_PKG=.*/im,
|
||||
"WEBI_PKG='" + pkg + '@' + ver + "'",
|
||||
)
|
||||
.replace(reInstallTpl, '\n' + installTxt);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Releases.renderPowerShell = async function (
|
||||
pkgdir,
|
||||
rel,
|
||||
|
||||
@@ -79,9 +79,6 @@ async function serveInstaller(baseurl, ua, pkg, tag, ext, formats) {
|
||||
rel.arches = rels.arches;
|
||||
rel.formats = rels.formats;
|
||||
|
||||
if ('bat' === ext) {
|
||||
return Releases.renderBatch(pkgdir, rel, opts);
|
||||
}
|
||||
if ('ps1' === ext) {
|
||||
return Releases.renderPowerShell(pkgdir, rel, opts);
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
REM REM debug
|
||||
|
||||
REM WEBI_PKG=
|
||||
|
||||
{{ installer }}
|
||||
@@ -851,7 +851,7 @@ sudo serviceman add --system --name caddy -- \
|
||||
```
|
||||
2. Install [`serviceman`](../serviceman/)
|
||||
```sh
|
||||
webi.bat serviceman
|
||||
webi serviceman
|
||||
```
|
||||
3. Create a **Startup Registry Entry** with Serviceman.
|
||||
```sh
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
pushd "%userprofile%" || goto :error
|
||||
pushd "%userprofile%\.local\opt" || goto :error
|
||||
powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip || goto :error
|
||||
rem Windows BSD-tar handles zip. Imagine that.
|
||||
tar xf node-v12.16.2-win-x64.zip || goto :error
|
||||
dir
|
||||
rename node-v12.16.2-win-x64 node-v12.16.2 || goto :error
|
||||
rmdir node-v12.16.2-win-x64
|
||||
del node-v12.16.2-win-x64.zip || goto :error
|
||||
popd || goto :error
|
||||
|
||||
rem make npm not act stupid about which node to use... ugh (this should be the default)
|
||||
.\.local\opt\node-v12.16.2\npm.cmd" --scripts-prepend-node-path=true config set scripts-prepend-node-path true || goto :error
|
||||
pathman add .local\opt\node-v12.16.2 || goto :error
|
||||
popd || goto :error
|
||||
|
||||
goto :EOF
|
||||
|
||||
:error
|
||||
echo Failed with error #%errorlevel%.
|
||||
exit /b %errorlevel%
|
||||
@@ -1 +0,0 @@
|
||||
rem do nothing because this is a special case
|
||||
Reference in New Issue
Block a user