Skip to content

Commit 07ad7f1

Browse files
committed
first commit
0 parents  commit 07ad7f1

28 files changed

+2404
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.21'
20+
21+
- name: Build
22+
run: |
23+
go build ./cmd
24+
25+
- name: Run Tests
26+
run: |
27+
go test -v ./cmd/... -coverprofile=coverage.txt -covermode=atomic
28+
29+
- name: Show Coverage
30+
run: |
31+
go tool cover -func=coverage.txt
32+
33+
- name: Run Lint
34+
run: |
35+
go install golang.org/x/lint/golint@latest
36+
golint ./cmd/...
37+
38+
- name: Run Vet
39+
run: |
40+
go vet ./cmd/...
41+
42+
- name: Run Static Analysis
43+
run: |
44+
go install github.com/alecthomas/gometalinter@latest
45+
gometalinter --install
46+
gometalinter ./cmd/... --disable-all --enable=errcheck --enable=gas --enable=goconst --enable=gofmt --enable=goimports --enable=golint --enable=gosimple --enable=ineffassign --enable=interfacer --enable=lll --enable=misspell --enable=staticcheck --enable=structcheck --enable=varcheck --enable=vet --enable=vetshadow

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
go-version: ['1.21']
14+
platform: [linux, darwin]
15+
arch: [amd64, arm64]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
22+
with:
23+
go-version: ${{ matrix.go-version }}
24+
25+
- name: Build
26+
run: |
27+
GOOS=${{ matrix.platform }} GOARCH=${{ matrix.arch }} go build -o persona2_${{ matrix.platform }}_${{ matrix.arch }} ./cmd
28+
29+
- name: Create Release
30+
id: create_release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ github.ref }}
36+
release_name: Release ${{ github.ref }}
37+
draft: false
38+
prerelease: false
39+
40+
- name: Upload Release Asset
41+
uses: actions/upload-release-asset@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
upload_url: ${{ steps.create_release.outputs.upload_url }}
46+
asset_path: ./persona2_${{ matrix.platform }}_${{ matrix.arch }}
47+
asset_name: persona2_${{ matrix.platform }}_${{ matrix.arch }}
48+
asset_content_type: application/octet-stream

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Go
2+
*.exe
3+
*.test
4+
*.prof
5+
*.out
6+
*.so
7+
*.a
8+
*.o
9+
*.bin
10+
*.test
11+
*.cover
12+
13+
# Build
14+
build/
15+
dist/
16+
bin/
17+
18+
# Dependencies
19+
vendor/
20+
21+
# IDE
22+
.idea/
23+
.vscode/
24+
*.swp
25+
*.swo
26+
27+
# Coverage
28+
coverage.txt
29+
30+
# Configuration
31+
~/.persona2/
32+
33+
# Test
34+
*.test
35+
36+
# Logs
37+
*.log
38+
39+
# OS
40+
.DS_Store
41+
Thumbs.db
42+
43+
# Debug
44+
*.pdb
45+
*.dSYM
46+
47+
# Temporary
48+
*.tmp
49+
*.temp
50+
*.bak
51+
*.backup
52+
persona2

README.fr.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Persona2
2+
3+
Gestionnaire de profils Git et de configuration
4+
5+
## Installation
6+
7+
Pour installer Persona2, utilisez la commande suivante :
8+
```bash
9+
go install github.com/yourusername/persona2/cmd/persona2@latest
10+
```
11+
12+
Après l'installation, initialisez la configuration :
13+
```bash
14+
persona2 init
15+
```
16+
17+
## Utilisation
18+
19+
### Initialiser la configuration
20+
Pour initialiser la configuration :
21+
```bash
22+
persona2 init
23+
```
24+
25+
Cette commande crée le fichier de configuration `~/.persona2.json` si celui-ci n'existe pas déjà.
26+
27+
### Ajouter un profil
28+
Pour ajouter un nouveau profil :
29+
```bash
30+
persona2 add --profile=<nom-profil> --url=<url-repository>
31+
```
32+
33+
### Lister les profils
34+
Pour lister tous les profils disponibles :
35+
```bash
36+
persona2 list
37+
```
38+
39+
### Changer de profil
40+
Pour changer de profil :
41+
```bash
42+
persona2 switch --profile=<nom-profil>
43+
```
44+
45+
### Supprimer un profil
46+
Pour supprimer un profil :
47+
```bash
48+
persona2 remove --profile=<nom-profil>
49+
```
50+
51+
### Mettre à jour un profil
52+
Pour mettre à jour un profil depuis son repository :
53+
```bash
54+
persona2 update --profile=<nom-profil>
55+
```
56+
57+
### Mettre à jour Persona2
58+
Pour mettre à jour Persona2 vers la dernière version :
59+
```bash
60+
persona2 self-update
61+
```

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Persona2
2+
3+
Git and Configuration Profile Manager
4+
5+
[Documentation française](README.fr.md)
6+
7+
## Installation
8+
9+
To install Persona2, use the following command:
10+
```bash
11+
go install github.com/yourusername/persona2/cmd/persona2@latest
12+
```
13+
14+
After installation, initialize the configuration:
15+
```bash
16+
persona2 init
17+
```
18+
19+
## Usage
20+
21+
### Initialize Configuration
22+
To initialize the configuration:
23+
```bash
24+
persona2 init
25+
```
26+
27+
This command creates the configuration file `~/.persona2.json` if it doesn't exist yet.
28+
29+
### Add a Profile
30+
To add a new profile:
31+
```bash
32+
persona2 add --profile=<profile-name> --url=<repository-url>
33+
```
34+
35+
### List Profiles
36+
To list all available profiles:
37+
```bash
38+
persona2 list
39+
```
40+
41+
### Switch Profile
42+
To switch to a different profile:
43+
```bash
44+
persona2 switch --profile=<profile-name>
45+
```
46+
47+
### Remove Profile
48+
To remove a profile:
49+
```bash
50+
persona2 remove --profile=<profile-name>
51+
```
52+
53+
### Update Profile
54+
To update a profile from its repository:
55+
```bash
56+
persona2 update --profile=<profile-name>
57+
```
58+
59+
### Self-Update
60+
To update Persona2 to the latest version:
61+
```bash
62+
persona2 self-update
63+
```

0 commit comments

Comments
 (0)