-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:rsdoiel/scripttool into gh-pages
- Loading branch information
Showing
11 changed files
with
117 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env pwsh | ||
# Generated with codemeta-ps1-installer.tmpl, see https://github.com/caltechlibrary/codemeta-pandoc-examples | ||
|
||
# | ||
# Set the package name and version to install | ||
# | ||
$$PACKAGE = "$name$" | ||
$$VERSION = "$version$" | ||
$$GIT_GROUP = "$git_org_or_person$" | ||
$$RELEASE = "https://github.com/$${GIT_GROUP}/$${PACKAGE}/releases/tag/v$${VERSION}" | ||
$$SYSTEM_TYPE = Get-ComputerInfo -Property CsSystemType | ||
if ($$SYSTEM_TYPE.CsSystemType.Contains("ARM64")) { | ||
$$MACHINE = "arm64" | ||
} else { | ||
$$MACHINE = "x86_64" | ||
} | ||
|
||
# FIGURE OUT Install directory | ||
$$BIN_DIR = "$${Home}\bin" | ||
Write-Output "$${PACKAGE} will be installed in $${BIN_DIR}" | ||
|
||
# | ||
# Figure out what the zip file is named | ||
# | ||
$$ZIPFILE = "$${PACKAGE}-v$${VERSION}-Windows-$${MACHINE}.zip" | ||
|
||
# | ||
# Check to see if this zip file has been downloaded. | ||
# | ||
$$DOWNLOAD_URL = "https://github.com/$${GIT_GROUP}/$${PACKAGE}/releases/download/v$${VERSION}/$${ZIPFILE}" | ||
|
||
if (!(Test-Path $$BIN_DIR)) { | ||
New-Item $$BIN_DIR -ItemType Directory | Out-Null | ||
} | ||
curl.exe -Lo "$${ZIPFILE}" "$${DOWNLOAD_URL}" | ||
|
||
tar.exe xf "$${ZIPFILE}" -C "$${Home}" | ||
|
||
Remove-Item $$ZIPFILE | ||
|
||
$$User = [System.EnvironmentVariableTarget]::User | ||
$$Path = [System.Environment]::GetEnvironmentVariable('Path', $$User) | ||
if (!(";$${Path};".ToLower() -like "*;$${BIN_DIR};*".ToLower())) { | ||
[System.Environment]::SetEnvironmentVariable('Path', "$${Path};$${BIN_DIR}", $$User) | ||
$$Env:Path += ";$${BIN_DIR}" | ||
} | ||
|
||
Write-Output "$${PACKAGE} was installed successfully to $${BIN_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env pwsh | ||
# Generated with codemeta-ps1-installer.tmpl, see https://github.com/caltechlibrary/codemeta-pandoc-examples | ||
|
||
# | ||
# Set the package name and version to install | ||
# | ||
$PACKAGE = "scripttool" | ||
$VERSION = "0.0.10" | ||
$GIT_GROUP = "rsdoiel" | ||
$RELEASE = "https://github.com/${GIT_GROUP}/${PACKAGE}/releases/tag/v${VERSION}" | ||
$SYSTEM_TYPE = Get-ComputerInfo -Property CsSystemType | ||
if ($SYSTEM_TYPE.CsSystemType.Contains("ARM64")) { | ||
$MACHINE = "arm64" | ||
} else { | ||
$MACHINE = "x86_64" | ||
} | ||
|
||
# FIGURE OUT Install directory | ||
$BIN_DIR = "${Home}\bin" | ||
Write-Output "${PACKAGE} will be installed in ${BIN_DIR}" | ||
|
||
# | ||
# Figure out what the zip file is named | ||
# | ||
$ZIPFILE = "${PACKAGE}-v${VERSION}-Windows-${MACHINE}.zip" | ||
|
||
# | ||
# Check to see if this zip file has been downloaded. | ||
# | ||
$DOWNLOAD_URL = "https://github.com/${GIT_GROUP}/${PACKAGE}/releases/download/v${VERSION}/${ZIPFILE}" | ||
|
||
if (!(Test-Path $BIN_DIR)) { | ||
New-Item $BIN_DIR -ItemType Directory | Out-Null | ||
} | ||
curl.exe -Lo "${ZIPFILE}" "${DOWNLOAD_URL}" | ||
|
||
tar.exe xf "${ZIPFILE}" -C "${Home}" | ||
|
||
Remove-Item $ZIPFILE | ||
|
||
$User = [System.EnvironmentVariableTarget]::User | ||
$Path = [System.Environment]::GetEnvironmentVariable('Path', $User) | ||
if (!(";${Path};".ToLower() -like "*;${BIN_DIR};*".ToLower())) { | ||
[System.Environment]::SetEnvironmentVariable('Path', "${Path};${BIN_DIR}", $User) | ||
$Env:Path += ";${BIN_DIR}" | ||
} | ||
|
||
Write-Output "${PACKAGE} was installed successfully to ${BIN_DIR}" |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"1.1.0","languages":{"en-us":{"hash":"en-us_1259a1251d43c","wasm":"en-us","page_count":9}}} | ||
{"version":"1.1.0","languages":{"en-us":{"hash":"en-us_3836a6e7e8520","wasm":"en-us","page_count":9}}} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters