From 6501bfd053309770f2480c0a5ef5a6bdd287b72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Morales=20Durand?= Date: Mon, 26 Dec 2022 17:10:01 -0300 Subject: [PATCH] Release v0.7.0 --- CHANGELOG.md | 9 ++++- DATE | 2 +- libexec/piHelp.sh | 7 +++- libexec/piParseCmdOptions.sh | 15 ++++++++ libexec/piPharo.sh | 70 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- 6 files changed, 101 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d6237e..4dc45b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [0.7.0](https://github.com/hernanmd/pi/compare/0.6.2...0.7.0) + +- Update README.md [`7a178bf`](https://github.com/hernanmd/pi/commit/7a178bf800b702077c4ccbc8f3fd6763e149f828) +- Add docs directory [`f58b42c`](https://github.com/hernanmd/pi/commit/f58b42ce338127525107cde377a161a713d55939) + #### [0.6.2](https://github.com/hernanmd/pi/compare/0.6.1...0.6.2) +> 14 June 2022 + +- Release v0.6.2 [`6964b46`](https://github.com/hernanmd/pi/commit/6964b461b426f07f0e9dd8f016a00b68549927f4) - Update README.md [`4beccfb`](https://github.com/hernanmd/pi/commit/4beccfb2dfd1666b0f4b259719864cc9166f6a13) - Add demo session [`b59547c`](https://github.com/hernanmd/pi/commit/b59547c36c54c8b5f63ad17399881ff4aded4430) -- Update README.md [`997d809`](https://github.com/hernanmd/pi/commit/997d8094e553fda959e6eab24d7c854c75eb688a) #### [0.6.1](https://github.com/hernanmd/pi/compare/0.6.0...0.6.1) diff --git a/DATE b/DATE index 96e01bb..20dd8e3 100644 --- a/DATE +++ b/DATE @@ -1 +1 @@ -14-06-2022 +26-12-2022 diff --git a/libexec/piHelp.sh b/libexec/piHelp.sh index 3242fc2..5e3548b 100644 --- a/libexec/piHelp.sh +++ b/libexec/piHelp.sh @@ -36,7 +36,12 @@ The options include: init Initialize and fetch PI Pharo package cache install Install pkgname to the Image found in the current directory.\n\t\tDownload image if not found. list List Pharo packages found in GitHub. - run Run a Pharo Image. + run Run a Pharo Image. + irun Download the stable image and run Pharo.image. + lrun Download the latest image and run Pharo.image. + nrun Download the stable image in a new timestamped directory and run Pharo.image. + nlrun Download the latest image in a new timestamped directory and run Pharo.image. + trun Trash pharo-local and run Pharo.image. search Search for pkgname in GitHub. update Update package directory. version Show program version. diff --git a/libexec/piParseCmdOptions.sh b/libexec/piParseCmdOptions.sh index 49fd9ba..0fcaef6 100644 --- a/libexec/piParseCmdOptions.sh +++ b/libexec/piParseCmdOptions.sh @@ -35,6 +35,21 @@ parse_cmd_line () { run | RUN ) run_pharo ;; + irun | IRUN ) + irun_pharo + ;; + lrun | LRUN ) + lrun_pharo + ;; + trun | TRUN ) + trun_pharo + ;; + nrun | NRUN ) + nrun_pharo + ;; + nlrun | NLRUN ) + nlrun_pharo + ;; search ) search_packages "${@:2}" ;; diff --git a/libexec/piPharo.sh b/libexec/piPharo.sh index 75a5201..670d288 100644 --- a/libexec/piPharo.sh +++ b/libexec/piPharo.sh @@ -4,6 +4,7 @@ # source "${BASH_SOURCE%/*}"/piUtils.sh +pharoLatest="110+vm" find_os_id () { # Find our distribution or OS @@ -79,6 +80,20 @@ yum_install () { libSM.i686 } +# Install latest version of Pharo +linstall_pharo () { + find_os_id + case "$os" in + "arm64") + zeroConfUrl="http://files.pharo.org/vm/pharo-spur64-headless/Darwin-arm64/latest.zip" + download_pharo_m1_latest + ;; + * ) + download_pharo_latest + ;; + esac +} + # Prefer provider packages if distribution was found install_pharo () { find_os_id @@ -120,6 +135,40 @@ run_pharo () { fi } +# Install a stable image and run Pharo +irun_pharo () { + install_pharo + run_pharo +} + +# Install latest Pharo and run Pharo.image +lrun_pharo () { + linstall_pharo + run_pharo +} + +# Trash pharo-local (requires trash utility) and run Pharo.image +trun_pharo () { + if [[ -d "pharo-local" ]]; then + trash pharo-local + fi + run_pharo +} + +# Trash pharo-local (requires trash utility) and run Pharo.image +nrun_pharo () { + dirname=$(date +%Y-%m-%d-%S) + mkdir -v "$dirname"; cd "$dirname" + irun_pharo +} + +# Install latest Pharo in a new timestamed directory and run Pharo.image +nlrun_pharo () { + dirname=$(date +%Y-%m-%d-%S) + mkdir -v "$dirname"; cd "$dirname" + lrun_pharo +} + download_pharo () { pi_log "Checking Pharo installation in the current directory...\n" if ! is_pharo_installed; then @@ -129,6 +178,15 @@ download_pharo () { [[ ! is_pharo_installed ]] && { pi_err "Could not download Pharo, exiting\n"; exit 1; } } +download_pharo_latest () { + pi_log "Checking latest Pharo installation in the current directory...\n" + if ! is_pharo_installed; then + pi_log "Downloading latest Pharo...\n" + exec $dApp $dPharoParams $zeroConfUrl/$pharoLatest | bash + fi + [[ ! is_pharo_installed ]] && { pi_err "Could not download latest Pharo, exiting\n"; exit 1; } +} + download_pharo_m1 () { pi_log "Checking Pharo installation in the current directory...\n" if ! is_pharo_installed; then @@ -138,4 +196,16 @@ download_pharo_m1 () { exec $dApp $dPharoParams get.pharo.org/64 | bash - fi [[ ! is_pharo_installed ]] && { pi_err "Could not download Pharo, exiting\n"; exit 1; } +} + +# Latest version of Pharo for ZeroConf download +download_pharo_m1_latest () { + pi_log "Checking latest Pharo installation in the current directory...\n" + if ! is_pharo_installed; then + pi_log "Downloading latest Pharo...\n" + exec $dApp $zeroConfUrl + unzip latest.zip + exec $dApp $dPharoParams get.pharo.org/64/$pharoLatest | bash - + fi + [[ ! is_pharo_installed ]] && { pi_err "Could not download latest Pharo, exiting\n"; exit 1; } } \ No newline at end of file diff --git a/package.json b/package.json index 1ca8615..eac8ade 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pi", - "version": "0.6.2", + "version": "0.7.0", "description": "", "main": "index.js", "type": "module",