Skip to content

Commit

Permalink
Merge branch 'main' of github.com:rsdoiel/scripttool into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
R. S. Doiel committed Jul 9, 2024
2 parents 1f4123a + d2f77f8 commit 7a37ca8
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 7 deletions.
5 changes: 4 additions & 1 deletion INSTALL.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ <h1 id="installation">Installation</h1>
<p><em>scripttool</em> is a command line program run from a shell like
Bash. You can find compiled version in the <a
href="https://github.com/rsdoiel/scripttool/releases/latest">releases</a></p>
<h2 id="quick-install-via-curl">Quick install via curl</h2>
<h2 id="quick-install-via-curl-or-irm">Quick install via curl or
irm</h2>
<p>This project can be installed via curl and sh for POSIX compatible
systems. Enter the following in your shell.</p>
<pre><code>curl https://rsdoiel.github.io/scripttool/installer.sh | sh</code></pre>
<p>On Windows use the following Powershell command.</p>
<pre><code>irm https://rsdoiel.github.io/scriptool/installer.ps1 | iex</code></pre>
<h2 id="compiled-version">Compiled version</h2>
<p>This is generalized instructions for a release.</p>
<p>Compiled versions are available for Mac OS (Intel and M1/M2
Expand Down
8 changes: 7 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installation

*scripttool* is a command line program run from a shell like Bash. You can find compiled version in the [releases](https://github.com/rsdoiel/scripttool/releases/latest)

## Quick install via curl
## Quick install via curl or irm

This project can be installed via curl and sh for POSIX compatible systems.
Enter the following in your shell.
Expand All @@ -16,6 +16,12 @@ Enter the following in your shell.
curl https://rsdoiel.github.io/scripttool/installer.sh | sh
~~~

On Windows use the following Powershell command.

~~~
irm https://rsdoiel.github.io/scriptool/installer.ps1 | iex
~~~

Compiled version
----------------

Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endif

DIST_FOLDERS = bin/*

build: version.go $(PROGRAMS) man CITATION.cff about.md installer.sh
build: version.go $(PROGRAMS) man CITATION.cff about.md installer.sh installer.ps1

version.go: .FORCE
echo '' | pandoc --from t2t --to plain \
Expand Down Expand Up @@ -92,10 +92,15 @@ about.md: .FORCE
@if [ -f _codemeta.json ]; then rm _codemeta.json; fi

installer.sh: .FORCE
@echo '' | pandoc --metadata title="Installer" --metadata git_org_or_person="$(GIT_GROUP)" --metadata-file codemeta.json --template codemeta-installer.tmpl >installer.sh
@echo '' | pandoc --metadata title="Installer" --metadata git_org_or_person="$(GIT_GROUP)" --metadata-file codemeta.json --template codemeta-bash-installer.tmpl >installer.sh
@chmod 775 installer.sh
@git add -f installer.sh

installer.ps1: .FORCE
@echo '' | pandoc --metadata title="Installer" --metadata git_org_or_person="$(GIT_GROUP)" --metadata-file codemeta.json --template codemeta-ps1-installer.tmpl >installer.ps1
@chmod 775 installer.ps1
@git add -f installer.ps1


clean-website:
make -f website.mak clean
Expand Down
File renamed without changes.
48 changes: 48 additions & 0 deletions codemeta-ps1-installer.tmpl
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}"
48 changes: 48 additions & 0 deletions installer.ps1
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 added pagefind/fragment/en-us_22c354f.pf_fragment
Binary file not shown.
Binary file added pagefind/index/en-us_cc2f0b2.pf_index
Binary file not shown.
2 changes: 1 addition & 1 deletion pagefind/pagefind-entry.json
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 added pagefind/pagefind.en-us_3836a6e7e8520.pf_meta
Binary file not shown.
4 changes: 2 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const (
Version = "0.0.10"

// ReleaseDate, the date version.go was generated
ReleaseDate = "2024-05-20"
ReleaseDate = "2024-07-09"

// ReleaseHash, the Git hash when version.go was generated
ReleaseHash = "28900db"
ReleaseHash = "70c880b"

LicenseText = `
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Expand Down

0 comments on commit 7a37ca8

Please sign in to comment.