Compare commits

...

7 Commits

Author SHA1 Message Date
Alexandre1a
1aa84809a6
Update README.md
Fixed indentation
2025-03-19 15:37:50 +01:00
Alexandre1a
af73e3e4de
Update README.md
Fixed a typo
2025-03-19 15:36:31 +01:00
Alexandre1a
ed30bd50d0
Update main.go
Changed some defaults
2025-03-19 15:33:16 +01:00
Alexandre1a
47761fae5d
Update go.yml
fixed the changelog not being displayed
2025-03-19 15:28:00 +01:00
Alexandre1a
1f19d9b602
Update go.yml
Deleted build.
Re added AMD64 into muliarch
2025-03-19 15:25:11 +01:00
Alexandre1a
9a9d0979de
Update go.yml
Removed the Linux64 build from multiarch as it's already built in the previous step
2025-03-19 15:20:39 +01:00
Alexandre1a
8be9ac9e82
Update go.yml
Fixed the indentation, and added a release overview
2025-03-19 15:18:54 +01:00
3 changed files with 56 additions and 28 deletions

View File

@ -8,22 +8,6 @@ on:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23.5"
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
build-multiarch:
runs-on: ubuntu-latest
steps:
@ -32,26 +16,25 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23.5"
go-version: "1.24.1"
- name: Build binaries for multiple architectures
run: |
mkdir -p dist
# Linux
GOOS=linux GOARCH=amd64 go build -o dist/gosh-linux-amd64
GOOS=linux GOARCH=arm64 go build -o dist/gosh-linux-arm64
# Windows
# GOOS=windows GOARCH=amd64 go build -o dist/gosh-windows-amd64.exe
# GOOS=windows GOARCH=arm64 go build -o dist/gosh-windows-arm64.exe
# macOS
GOOS=darwin GOARCH=amd64 go build -o dist/gosh-mac-amd64
GOOS=darwin GOARCH=arm64 go build -o dist/gosh-mac-arm64
ls -lh dist/
# Windows
# GOOS=windows GOARCH=amd64 go build -o dist/gosh-windows-amd64.exe
# GOOS=windows GOARCH=arm64 go build -o dist/gosh-windows-arm64.exe
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v4
with:
@ -71,10 +54,46 @@ jobs:
name: gosh-binaries
path: dist/
- name: Generate Changelog
id: changelog
run: |
CURRENT_TAG=${GITHUB_REF#refs/tags/}
# Get all tags sorted by version (descending)
ALL_TAGS=$(git tag --sort=-version:refname)
PREVIOUS_TAG=""
found_current=0
# Find the tag immediately before the current one
for tag in $ALL_TAGS; do
if [ "$found_current" -eq 1 ]; then
PREVIOUS_TAG=$tag
break
fi
if [ "$tag" == "$CURRENT_TAG" ]; then
found_current=1
fi
done
# Fallback to initial commit if no previous tag
if [ -z "$PREVIOUS_TAG" ]; then
PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
fi
# Generate changelog
CHANGELOG=$(git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..$CURRENT_TAG)
if [ -z "$CHANGELOG" ]; then
CHANGELOG="No changes since previous release."
fi
# Output for GitHub Action
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
body: |
**Changelog**
${{ steps.changelog.outputs.CHANGELOG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -19,7 +19,7 @@ To test the shell and see if it suits you.
If everything works, then move the binary to a place inside your path.
To directly install it with the Go toolchain, just use
`go intall`
`go install`
This will build and place the binary inside your `$HOME/go/bin` folder.
Add this folder to your path and you are good to go !
@ -29,7 +29,16 @@ To use the program, just invoke it with `GoSH`
To change config parameter on the fly, use the `set` builtin.
Currently, `set` has a limited amount of configuration options and need to have a valid config file to write to.
To change the color of the prompt use `set color <color>`
All the avalable colors : black red purple cyan white green yellow blue
All the avalable colors :
- black
- red
- purple
- cyan
- white
- green
- yellow
- blue
You can change the history size with `set history_size <int>`
You can change the prompt with `set prompt <promp>`
Here is some exemple of prompts :

View File

@ -86,8 +86,8 @@ func loadConfig() {
viper.SetConfigType("toml")
// Valeurs par défaut
viper.SetDefault("prompt", "[{dir}] > ")
viper.SetDefault("color", "blue")
viper.SetDefault("prompt", "[{dir}] $ ")
viper.SetDefault("color", "green")
viper.SetDefault("history_size", 1000)
// Lire le fichier de configuration