Skip to content

Commit 4b9b5df

Browse files
authored
Merge pull request #11 from xeyossr/fix
Fix empty username
2 parents 4fc1721 + 7a9c291 commit 4b9b5df

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

aur/.SRCINFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pkgbase = pulsarship
22
pkgdesc = 🚀🌠 A minimal, fast, and customizable prompt written in Go
3-
pkgver = 0.2.3
3+
pkgver = 0.2.4
44
pkgrel = 1
55
url = https://github.com/xeyossr/pulsarship
66
arch = x86_64
@@ -10,7 +10,7 @@ pkgbase = pulsarship
1010
license = GPL3
1111
makedepends = go
1212
makedepends = git
13-
source = git+https://github.com/xeyossr/pulsarship.git#tag=v0.2.3
13+
source = git+https://github.com/xeyossr/pulsarship.git#tag=v0.2.4
1414
sha256sums = SKIP
1515

1616
pkgname = pulsarship

aur/PKGBUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Maintainer: kamisaki
1+
# Maintainer: xeyossr
22
# Description: 🚀🌠 A minimal, fast, and customizable prompt written in Go
33

44
pkgname=pulsarship
5-
pkgver=0.2.3
5+
pkgver=0.2.4
66
pkgrel=1
77
pkgdesc="🚀🌠 A minimal, fast, and customizable prompt written in Go"
88
arch=('x86_64' 'aarch64' 'armv7h' 'i686')

internal/components/username.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,8 @@ func init() {
2222
}
2323

2424
func (u *UsernameComponent) Val() (string, error) {
25-
username, err := user.Current()
26-
if def := utils.Must(err, ""); def != nil {
27-
return *def, err
28-
}
29-
30-
if username.Name == "" {
31-
return "", nil
32-
}
33-
34-
return username.Name, nil
25+
username := os.Getenv("USER")
26+
return username, nil
3527
}
3628

3729
func (u *UsernameComponent) Render() (models.Result, error) {

0 commit comments

Comments
 (0)