Skip to content

Commit

Permalink
Change name, update go version in go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdmuckle committed Jul 22, 2020
1 parent 0820e99 commit 22ef905
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# goify [Tentative Name]
# spc

![Go](https://github.com/dvdmuckle/goify/workflows/Go/badge.svg?branch=master)
![Go](https://github.com/dvdmuckle/spc/workflows/Go/badge.svg?branch=master)

A lightweight mutliplatform CLI for Spotify

## Setup

To set up the app, run `goify` to generate a skeleton config file at `~/.config/goify/config.yaml`. Next, head to <http://developer.spotify.com/> to create a new Spotify app. Paste the ClientID and ClientSecret in the config as noted. You can now run `goify auth` to start the OAuth2 flow, which will have you grant the Spotify app you created, and thus goify, the correct API permissions.
To set up the app, run `spc` to generate a skeleton config file at `~/.config/spc/config.yaml`. Next, head to <http://developer.spotify.com/> to create a new Spotify app. Paste the ClientID and ClientSecret in the config as noted. You can now run `spc auth` to start the OAuth2 flow, which will have you grant the Spotify app you created, and thus spc, the correct API permissions.

## Running

Because this app is in constant development, please refer to `goify help` for what functionality is available in the app.
Because this app is in constant development, please refer to `spc help` for what functionality is available in the app.

## Goals

Expand Down
2 changes: 1 addition & 1 deletion cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/helper/authHelp.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Auth(cmd *cobra.Command, viper *viper.Viper, cfgFile string, conf *Config)
clientID = conf.ClientID
secret = conf.Secret
if clientID == "" || secret == "" {
fmt.Println("Please configure your Spotify client ID and secret in the config file at ~/.config/goify/config.yaml")
fmt.Println("Please configure your Spotify client ID and secret in the config file at ~/.config/spc/config.yaml")
os.Exit(1)
}

Expand Down Expand Up @@ -115,7 +115,7 @@ func RefreshToken(client string, secret string, refreshToken string) *oauth2.Tok
//The Token field in the Config struct must be set
func SetClient(conf *Config) {
if conf.Token == (oauth2.Token{}) {
fmt.Println("Please run goify auth first to login")
fmt.Println("Please run spc auth first to login")
os.Exit(1)
}
conf.Token = *RefreshToken(conf.ClientID, conf.Secret, conf.Token.RefreshToken)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/spf13/cobra"
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"strings"

"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/golang/glog"
"github.com/zmb3/spotify"

Expand All @@ -40,7 +40,7 @@ var cfgFile string

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "goify",
Use: "spc",
Short: "Command line tool to control Spotify",
Long: `Goify is a simple command line tool to control Spotify using the Spotify API
to allow for cross platform use. It is designed to be simple and is limited in
Expand All @@ -59,18 +59,18 @@ func Execute() {

func init() {
cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "Config file (default is $HOME/.config/goify/config.yaml)")
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "Config file (default is $HOME/.config/spc/config.yaml)")
}

// createConfig creates the config file at ~/.config/goify/config.yaml if it does not exist
// createConfig creates the config file at ~/.config/spc/config.yaml if it does not exist
func createConfig() {
// Find home directory.
home, err := homedir.Dir()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
configPath := home + "/.config/goify"
configPath := home + "/.config/spc"
if err := os.MkdirAll(configPath, 0755); err != nil {
glog.Fatal("Error creating config path: ", err)
}
Expand All @@ -84,7 +84,7 @@ func createConfig() {
if err := viper.WriteConfigAs(cfgFile); err != nil {
glog.Fatal("Error writing config file:", err)
}
fmt.Printf("Config file created at ~/.config/goify/config.yaml\n\n")
fmt.Printf("Config file created at ~/.config/spc/config.yaml\n\n")
}
}

Expand Down
8 changes: 4 additions & 4 deletions cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"regexp"
"strings"

"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/golang/glog"
"github.com/ktr0731/go-fuzzyfinder"
"github.com/spf13/cobra"
Expand All @@ -36,9 +36,9 @@ var searchCmd = &cobra.Command{
Search type can be an album, a track, or a playlist, with the rest of the arguments
making up the search query. For example:
goify search album moving pictures
goify search track tom sawyer
goify search playlist prog monsters
spc search album moving pictures
spc search track tom sawyer
spc search playlist prog monsters
If a track is queried for, additional similar songs will be queued up.
Expand Down
2 changes: 1 addition & 1 deletion cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strconv"
"time"

"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/zmb3/spotify"
Expand Down
2 changes: 1 addition & 1 deletion cmd/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"os"

"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/golang/glog"
"github.com/ktr0731/go-fuzzyfinder"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"os"
"strconv"

"github.com/dvdmuckle/goify/cmd/helper"
"github.com/dvdmuckle/spc/cmd/helper"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/dvdmuckle/goify
module github.com/dvdmuckle/spc

go 1.13
go 1.14

require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/
package main

import "github.com/dvdmuckle/goify/cmd"
import "github.com/dvdmuckle/spc/cmd"

func main() {
cmd.Execute()
Expand Down

0 comments on commit 22ef905

Please sign in to comment.