Skip to content

Commit 07cd0a4

Browse files
authored
fix wording project name
2 parents 07ad7f1 + 26dfce9 commit 07cd0a4

File tree

7 files changed

+129
-49
lines changed

7 files changed

+129
-49
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ trunk ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ trunk ]
88

99
jobs:
1010
build:
@@ -26,21 +26,13 @@ jobs:
2626
run: |
2727
go test -v ./cmd/... -coverprofile=coverage.txt -covermode=atomic
2828
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
29+
- name: Run Go Analysis
3930
run: |
4031
go vet ./cmd/...
32+
go list -e ./cmd/... 2>&1 | grep -v '^$'
33+
go fmt ./cmd/...
34+
go mod tidy
4135
42-
- name: Run Static Analysis
36+
- name: Show Coverage
4337
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
38+
go tool cover -func=coverage.txt

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ name: Release
22

33
on:
44
push:
5+
branches:
6+
- trunk
57
tags:
6-
- 'v*'
8+
- 'v*' # Active le workflow pour les tags commençant par v
9+
pull_request:
10+
branches:
11+
- trunk
12+
branches-ignore:
13+
- main
714

815
jobs:
916
release:
@@ -24,7 +31,7 @@ jobs:
2431

2532
- name: Build
2633
run: |
27-
GOOS=${{ matrix.platform }} GOARCH=${{ matrix.arch }} go build -o persona2_${{ matrix.platform }}_${{ matrix.arch }} ./cmd
34+
GOOS=${{ matrix.platform }} GOARCH=${{ matrix.arch }} go build -o persona_${{ matrix.platform }}_${{ matrix.arch }} ./cmd
2835
2936
- name: Create Release
3037
id: create_release
@@ -43,6 +50,6 @@ jobs:
4350
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4451
with:
4552
upload_url: ${{ steps.create_release.outputs.upload_url }}
46-
asset_path: ./persona2_${{ matrix.platform }}_${{ matrix.arch }}
47-
asset_name: persona2_${{ matrix.platform }}_${{ matrix.arch }}
53+
asset_path: ./persona_${{ matrix.platform }}_${{ matrix.arch }}
54+
asset_name: persona_${{ matrix.platform }}_${{ matrix.arch }}
4855
asset_content_type: application/octet-stream

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ vendor/
2828
coverage.txt
2929

3030
# Configuration
31-
~/.persona2/
31+
~/.persona/
3232

3333
# Test
3434
*.test

README.fr.md

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,99 @@ Gestionnaire de profils Git et de configuration
66

77
Pour installer Persona2, utilisez la commande suivante :
88
```bash
9-
go install github.com/yourusername/persona2/cmd/persona2@latest
9+
go install github.com/yourusername/persona/cmd/persona@latest
1010
```
1111

1212
Après l'installation, initialisez la configuration :
1313
```bash
14-
persona2 init
14+
persona init
1515
```
1616

1717
## Utilisation
1818

1919
### Initialiser la configuration
2020
Pour initialiser la configuration :
2121
```bash
22-
persona2 init
22+
persona init
2323
```
2424

25-
Cette commande crée le fichier de configuration `~/.persona2.json` si celui-ci n'existe pas déjà.
25+
Cette commande crée le fichier de configuration `~/.persona.json` si celui-ci n'existe pas déjà. Elle crée également le dossier `~/.persona/profiles` où seront stockés tous les profils.
2626

2727
### Ajouter un profil
2828
Pour ajouter un nouveau profil :
2929
```bash
30-
persona2 add --profile=<nom-profil> --url=<url-repository>
30+
persona add --url=<url-repository>
3131
```
3232

33+
Le nom du profil peut être extrait de l'URL si non fourni. Le repository sera cloné dans `~/.persona/profiles/<nom-profil>`.
34+
3335
### Lister les profils
3436
Pour lister tous les profils disponibles :
3537
```bash
36-
persona2 list
38+
persona list
3739
```
3840

41+
Cette commande affiche tous les profils disponibles et leur statut actuel (actif ou inactif).
42+
3943
### Changer de profil
4044
Pour changer de profil :
4145
```bash
42-
persona2 switch --profile=<nom-profil>
46+
persona switch --profile=<nom-profil>
4347
```
4448

49+
Cette commande crée des liens symboliques vers les fichiers de configuration du profil sélectionné. Si des fichiers existent déjà dans l'emplacement cible, la commande demandera une confirmation avant de les remplacer.
50+
4551
### Supprimer un profil
4652
Pour supprimer un profil :
4753
```bash
48-
persona2 remove --profile=<nom-profil>
54+
persona remove --profile=<nom-profil>
4955
```
5056

57+
Cette commande supprime le profil et ses liens symboliques. Elle demandera une confirmation avant de procéder.
58+
5159
### Mettre à jour un profil
5260
Pour mettre à jour un profil depuis son repository :
5361
```bash
54-
persona2 update --profile=<nom-profil>
62+
persona update --profile=<nom-profil>
5563
```
5664

65+
Pour mettre à jour tous les profils :
66+
```bash
67+
persona2 update
68+
```
69+
70+
Cette commande récupère les dernières modifications depuis le repository et met à jour les fichiers locaux.
71+
5772
### Mettre à jour Persona2
5873
Pour mettre à jour Persona2 vers la dernière version :
5974
```bash
60-
persona2 self-update
75+
persona self-update
6176
```
77+
78+
Cette commande télécharge et installe la dernière version de Persona2 depuis GitHub.
79+
80+
## Configuration
81+
82+
Le fichier de configuration est situé à `~/.persona.json` et contient :
83+
- Liste de tous les profils
84+
- Profil actif
85+
- Alias des profils
86+
- Paramètres de configuration
87+
88+
## Structure des profils
89+
90+
Chaque profil est stocké dans `~/.persona/profiles/<nom-profil>` et doit contenir :
91+
- Fichiers de configuration
92+
- Dotfiles
93+
- Autres ressources de configuration
94+
95+
Lors du changement de profil, Persona2 crée des liens symboliques des fichiers du profil vers leurs emplacements appropriés dans votre dossier personnel.
96+
97+
## Support
98+
99+
Langues disponibles :
100+
- Anglais
101+
- Français
102+
- Allemand
103+
104+
L'application supporte l'internationalisation et peut être utilisée dans plusieurs langues.

README.md

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,96 @@ Git and Configuration Profile Manager
66

77
## Installation
88

9-
To install Persona2, use the following command:
10-
```bash
11-
go install github.com/yourusername/persona2/cmd/persona2@latest
12-
```
13-
149
After installation, initialize the configuration:
1510
```bash
16-
persona2 init
11+
persona init
1712
```
1813

1914
## Usage
2015

2116
### Initialize Configuration
2217
To initialize the configuration:
2318
```bash
24-
persona2 init
19+
persona init
2520
```
2621

27-
This command creates the configuration file `~/.persona2.json` if it doesn't exist yet.
22+
This command creates the configuration file `~/.persona.json` if it doesn't exist yet. It also creates the directory `~/.persona/profiles` where all profiles will be stored.
2823

2924
### Add a Profile
3025
To add a new profile:
3126
```bash
32-
persona2 add --profile=<profile-name> --url=<repository-url>
27+
persona add --url=<repository-url>
3328
```
3429

30+
The profile name can be extracted from the URL if not provided. The repository will be cloned into `~/.persona/profiles/<profile-name>`.
31+
3532
### List Profiles
3633
To list all available profiles:
3734
```bash
38-
persona2 list
35+
persona list
3936
```
4037

38+
This command shows all available profiles and their current status (active or inactive).
39+
4140
### Switch Profile
4241
To switch to a different profile:
4342
```bash
44-
persona2 switch --profile=<profile-name>
43+
persona switch --profile=<profile-name>
4544
```
4645

46+
This command creates symbolic links to the configuration files of the selected profile. If files already exist in the target location, the command will prompt for confirmation before replacing them.
47+
4748
### Remove Profile
4849
To remove a profile:
4950
```bash
50-
persona2 remove --profile=<profile-name>
51+
persona remove --profile=<profile-name>
5152
```
5253

54+
This command removes the profile and its symbolic links. It will prompt for confirmation before proceeding.
55+
5356
### Update Profile
5457
To update a profile from its repository:
5558
```bash
56-
persona2 update --profile=<profile-name>
59+
persona update --profile=<profile-name>
60+
```
61+
62+
To update all profiles:
63+
```bash
64+
persona2 update
5765
```
5866

67+
This command fetches the latest changes from the repository and updates the local files.
68+
5969
### Self-Update
6070
To update Persona2 to the latest version:
6171
```bash
62-
persona2 self-update
72+
persona self-update
6373
```
74+
75+
This command downloads and installs the latest version of Persona2 from GitHub.
76+
77+
## Configuration
78+
79+
The configuration file is located at `~/.persona.json` and contains:
80+
- List of all profiles
81+
- Current active profile
82+
- Profile aliases
83+
- Configuration settings
84+
85+
## Profile Structure
86+
87+
Each profile is stored in `~/.persona/profiles/<profile-name>` and should contain:
88+
- Configuration files
89+
- Dotfiles
90+
- Any other configuration resources
91+
92+
When switching profiles, Persona2 creates symbolic links from the profile files to their appropriate locations in your home directory.
93+
94+
## Support
95+
96+
Available languages:
97+
- English
98+
- French
99+
- German
100+
101+
The application supports internationalization and can be used in multiple languages.

cmd/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func init() {
2424
// Initialize configuration
2525
viper.SetConfigName("config")
2626
viper.SetConfigType("json")
27-
viper.AddConfigPath("~/.persona2")
27+
viper.AddConfigPath("~/.persona")
2828

2929
// Create the configuration directory if it does not exist
30-
configDir := filepath.Join(os.Getenv("HOME"), ".persona2")
30+
configDir := filepath.Join(os.Getenv("HOME"), ".persona")
3131
if err := os.MkdirAll(configDir, 0755); err != nil {
3232
fmt.Printf(T("error.config_dir", map[string]interface{}{"error": err.Error()}))
3333
os.Exit(1)

cmd/self_update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var selfUpdateCmd = &cobra.Command{
5252
}
5353

5454
// Rename new binary
55-
newBinPath := filepath.Join(filepath.Dir(binPath), "persona2_new")
55+
newBinPath := filepath.Join(filepath.Dir(binPath), "persona_new")
5656
if err := os.Rename(newBinPath, binPath); err != nil {
5757
fmt.Println(T("self_update.error_rename", err))
5858
return
@@ -72,7 +72,7 @@ func getLatestRelease() (string, error) {
7272
func downloadRelease(version string) error {
7373
// TODO: Implement downloading release from GitHub
7474
// For now, create temporary file for testing
75-
tempFile := filepath.Join(os.TempDir(), fmt.Sprintf("persona2_%s", version))
75+
tempFile := filepath.Join(os.TempDir(), fmt.Sprintf("persona_%s", version))
7676
file, err := os.Create(tempFile)
7777
if err != nil {
7878
return err

0 commit comments

Comments
 (0)