Skip to content

Commit

Permalink
1.0.0 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
sqshq committed Jul 29, 2019
1 parent d7d3831 commit 18d8a08
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
patreon: sampler
custom: ['http://sampler.dev/#pricing']
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ Sampler is a tool for shell commands execution, visualization and alerting. Conf

### macOS
```bash
sudo curl -Lo /usr/local/bin/sampler https://github.com/sqshq/sampler/releases/download/v0.9.1-beta/sampler-0.9.1-darwin-amd64
sudo curl -Lo /usr/local/bin/sampler https://github.com/sqshq/sampler/releases/download/v1.0.0/sampler-1.0.0-darwin-amd64
sudo chmod +x /usr/local/bin/sampler
```
### Linux
```bash
sudo wget https://github.com/sqshq/sampler/releases/download/v0.9.1-beta/sampler-0.9.1-linux-amd64 -O /usr/local/bin/sampler
sudo wget https://github.com/sqshq/sampler/releases/download/v1.0.0/sampler-1.0.0-linux-amd64 -O /usr/local/bin/sampler
sudo chmod +x /usr/local/bin/sampler
```
### Windows
[download .exe](https://github.com/sqshq/sampler/releases/download/v0.9.1-beta/sampler-0.9.1-windows)
Recommended to use with advanced console emulators, e.g. [Cmder](https://cmder.net/)

[Download .exe](https://github.com/sqshq/sampler/releases/download/v1.0.0/sampler-1.0.0-windows-amd64.exe)

## Usage
You specify shell commands, Sampler executes them with a required rate. The output is used for visualization.
Expand Down
2 changes: 1 addition & 1 deletion console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
ColumnsCount = 80
RowsCount = 40
AppTitle = "sampler"
AppVersion = "0.9.1"
AppVersion = "1.0.0"
AppLicenseWarning = "UNLICENSED. FOR NON-COMMERCIAL USE ONLY. VISIT WWW.SAMPLER.DEV"
)

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ func main() {
statistics := metadata.GetStatistics(cfg)
license := metadata.GetLicense()

defer handleCrash(statistics, opt, bc)
defer updateStatistics(cfg, time.Now())

if opt.LicenseKey != nil {
registerLicense(statistics, opt, bc)
}
Expand All @@ -89,6 +86,9 @@ func main() {
player := asset.NewAudioPlayer()
defer player.Close()

defer handleCrash(statistics, opt, bc)
defer updateStatistics(cfg, time.Now())

palette := console.GetPalette(*cfg.Theme)
lout := layout.NewLayout(component.NewStatusLine(*opt.ConfigFile, palette, license),
component.NewMenu(palette), component.NewIntro(palette), component.NewNagWindow(palette))
Expand Down
1 change: 1 addition & 0 deletions metadata/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func PersistStatistics(config *config.Config, uptime time.Duration) *Statistics
statistics.ComponentsCount = countComponentsPerType(config)
}

statistics.Version = console.AppVersion
statistics.WindowWidth = w
statistics.WindowHeight = h
statistics.LaunchCount += 1
Expand Down
7 changes: 4 additions & 3 deletions metadata/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const (
macOSDir = "/Library/Application Support/Sampler"
linuxDir = "/.config/Sampler"
windowsDir = "%LOCALAPPDATA%\\Sampler"
windowsDir = "Sampler"
)

func fileExists(filename string) bool {
Expand All @@ -20,12 +20,13 @@ func fileExists(filename string) bool {
}

func getPlatformStoragePath(filename string) string {
home, _ := os.UserHomeDir()
switch runtime.GOOS {
case "darwin":
home, _ := os.UserHomeDir()
return filepath.Join(home, macOSDir, filename)
case "windows":
return filepath.Join(home, windowsDir, filename)
cache, _ := os.UserCacheDir()
return filepath.Join(cache, windowsDir, filename)
default:
return filepath.Join(linuxDir, filename)
}
Expand Down

0 comments on commit 18d8a08

Please sign in to comment.