Skip to content

Commit

Permalink
Merge pull request #14 from zeppaman/installer
Browse files Browse the repository at this point in the history
Installer
  • Loading branch information
zeppaman authored Dec 11, 2022
2 parents eef5b79 + 48f3290 commit ff66e74
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
shell: bash
run: |
TITLE='Latest'
BODY='Test release'
BODY=$(cat ./release/description.md)
go install github.com/tcnksm/ghr
ghr -n="$NAME" -b="$CHANGELOG" -replace -delete $NEW_TAG ./out/
ghr -n="$TITLE" -b="$BODY" -replace -delete latest ./out/
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@ Bashy provides a easy way for resolving arguments and generating an useful Help.
You can simply have variable filled with values entered by the user by default, and the help infos build automatically from the script definition. This transofrms your bash script in a real console application with no pain

# How to install
There isnt any installer so far. You can install it by cloning the repo and running the install file.
The installation package is available for windows and linux. It was tested on Window 10&11, Ubuntu, Debian and Alpine. If the binay is not compatible with your OS or processor, you can compile it from source (see next section).

## Instal on Linux

Copy the next piece of code and run in your terminal.

```bash
curl -LO https://github.com/zeppaman/bashy/releases/download/latest/bashy.linux && install -m 0755 ./bashy.linux /usr/bin/bashy && rm ./bashy.linux && echo 'export PATH="$PATH:$HOME/.bashy/bin"'>>~/.bashrc && echo 'export PATH="$PATH:$HOME/.bashy/bin"'>>~/.profile && echo 'export PATH="$PATH:$HOME/.bashy/bin"'>>/etc/environment && export PATH="$PATH:$HOME/.bashy/bin"
```
*note*: basing on your os you may need to be root to run the command. Requires curl installed.

## Install on windows
Open a powershell console with elevated privileges and run:

```ps
$bashyHome=$([Environment]::GetFolderPath("UserProfile"))+"\.bashy"; New-Item -ItemType Directory -Force -Path $bashyHome\bin; (New-Object System.Net.WebClient).DownloadFile('https://github.com/zeppaman/bashy/releases/download/latest/bashy.windows', "$bashyHome\bin\bashy.exe"); $old = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User); $env:Path= "$old;$bashyHome\bin"; [Environment]::SetEnvironmentVariable("Path", "$old;$bashyHome\bin", [System.EnvironmentVariableTarget]::User);
```


# Compiling from source

# Linux or WSL
```bash
git clone <this repo url> bashy
cd bashy
bash ./install.sh
```
The script build executables in out folder. Copy them where you want and make sure to add the binary location on PATH and the /bin subfloder of BASHY_HOME folder (default is .bashy inside you home/profile folder)

installation notes:
- this compile bashy form source, so you can delete the folder at the end
- the tool download and install go if not present. If present, nothing is touched but it have to be updated manually to the 1.19 version.
Expand Down
6 changes: 1 addition & 5 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Write-Host $bashyHome
New-Item -ItemType Directory -Force -Path $bashyHome\bin | Select-Object "bashy home created"
Copy-Item ./out/debug/bashy -Destination $bashyHome\bin\bashy.exe -Recurse

#TODO: DO THE SAME FOR[System.EnvironmentVariableTarget]::Machine


$old = [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User)
if ($old -like "*$bashyHome\bin*") {
Expand All @@ -61,7 +61,3 @@ if ($old -like "*$bashyHome\bin*") {
$new = "$old;$bashyHome\bashy.exe"
[Environment]::SetEnvironmentVariable("Path", $new, [System.EnvironmentVariableTarget]::User)
}




6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ fi
#compile the tool

bin/task build-debug
cp ./out/debug/bashy /usr/bin/bashy
export PATH="$PATH:/root/.bashy/bin"
echo 'export PATH="$PATH:/root/.bashy/bin"' >>~/.profile
# cp ./out/debug/bashy /usr/bin/bashy
# export PATH="$PATH:/root/.bashy/bin"
# echo 'export PATH="$PATH:/root/.bashy/bin"' >>~/.profile

#wget https://github.com/zeppaman/bashy/releases/download/v1.0.1/bashy

Expand Down
Empty file added release/artifacts/.gitkeep
Empty file.
10 changes: 10 additions & 0 deletions release/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This is the **Bashy** release. The binaries are burnt using following conventions:
- bashy.OSNAME are general purpose binaries valid for most distribution
- bashy.ARCH.OSNAME are binaries compiled for the couple Archiecture/OS (Es. Linux x86)

There isn't any plan to relese distribution specific installer. Anyway, GOLANG is quite compatible with most OS and distribution, so Bashy can run quite everywhere as it use only pure GO constructs.

If there isn't any option for you OS you can:
1. compile it by yourself following istruction in the project README
2. Enanche the build process to include your OS in the pipeline. To do this, just fork the repo, change the Taskfile.yaml and make a pullrequest

0 comments on commit ff66e74

Please sign in to comment.