mirror of
https://github.com/Alexandre1a/GoSH.git
synced 2026-03-10 03:29:47 +01:00
Compare commits
7 Commits
c882c891d4
...
1aa84809a6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1aa84809a6 | ||
|
|
af73e3e4de | ||
|
|
ed30bd50d0 | ||
|
|
47761fae5d | ||
|
|
1f19d9b602 | ||
|
|
9a9d0979de | ||
|
|
8be9ac9e82 |
65
.github/workflows/go.yml
vendored
65
.github/workflows/go.yml
vendored
@ -8,22 +8,6 @@ on:
|
|||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
|
|
||||||
jobs:
|
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:
|
build-multiarch:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -32,26 +16,25 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: "1.23.5"
|
go-version: "1.24.1"
|
||||||
|
|
||||||
- name: Build binaries for multiple architectures
|
- name: Build binaries for multiple architectures
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
GOOS=linux GOARCH=amd64 go build -o dist/gosh-linux-amd64
|
GOOS=linux GOARCH=amd64 go build -o dist/gosh-linux-amd64
|
||||||
GOOS=linux GOARCH=arm64 go build -o dist/gosh-linux-arm64
|
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
|
# macOS
|
||||||
GOOS=darwin GOARCH=amd64 go build -o dist/gosh-mac-amd64
|
GOOS=darwin GOARCH=amd64 go build -o dist/gosh-mac-amd64
|
||||||
GOOS=darwin GOARCH=arm64 go build -o dist/gosh-mac-arm64
|
GOOS=darwin GOARCH=arm64 go build -o dist/gosh-mac-arm64
|
||||||
|
|
||||||
ls -lh dist/
|
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
|
- name: Upload binaries as artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -71,10 +54,46 @@ jobs:
|
|||||||
name: gosh-binaries
|
name: gosh-binaries
|
||||||
path: dist/
|
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
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: dist/*
|
files: dist/*
|
||||||
|
body: |
|
||||||
|
**Changelog**
|
||||||
|
${{ steps.changelog.outputs.CHANGELOG }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
13
README.md
13
README.md
@ -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.
|
If everything works, then move the binary to a place inside your path.
|
||||||
|
|
||||||
To directly install it with the Go toolchain, just use
|
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.
|
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 !
|
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.
|
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.
|
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>`
|
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 history size with `set history_size <int>`
|
||||||
You can change the prompt with `set prompt <promp>`
|
You can change the prompt with `set prompt <promp>`
|
||||||
Here is some exemple of prompts :
|
Here is some exemple of prompts :
|
||||||
|
|||||||
4
main.go
4
main.go
@ -86,8 +86,8 @@ func loadConfig() {
|
|||||||
viper.SetConfigType("toml")
|
viper.SetConfigType("toml")
|
||||||
|
|
||||||
// Valeurs par défaut
|
// Valeurs par défaut
|
||||||
viper.SetDefault("prompt", "[{dir}] > ")
|
viper.SetDefault("prompt", "[{dir}] $ ")
|
||||||
viper.SetDefault("color", "blue")
|
viper.SetDefault("color", "green")
|
||||||
viper.SetDefault("history_size", 1000)
|
viper.SetDefault("history_size", 1000)
|
||||||
|
|
||||||
// Lire le fichier de configuration
|
// Lire le fichier de configuration
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user