Makes sure that the import name matches the module title, rather than the remote repo path
This commit is contained in:
parent
9db8c791c3
commit
f6856766bf
11
main.go
11
main.go
@ -9,8 +9,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
helptext string = `slp - slope package manager
|
||||
|
||||
banner string = "\033[32;1mslp - slope package manager\033[0m"
|
||||
helptext string = `
|
||||
slp docs [module] # open a module's readme in $PAGER
|
||||
slp gen # creates new module dir/skeleton
|
||||
slp help # print usage information
|
||||
@ -20,14 +20,13 @@ slp list # lists all available packages
|
||||
slp remove [module...] # removes module(s)
|
||||
slp search [term...] # searches for modules
|
||||
slp show [module...] # shows details module(s)
|
||||
slp update [module...] # updates module(s)
|
||||
|
||||
`
|
||||
slp update [module...] # updates module(s)`
|
||||
)
|
||||
|
||||
func main() {
|
||||
arg := os.Args
|
||||
if len(arg) <= 1 {
|
||||
fmt.Println(banner)
|
||||
fmt.Println(helptext)
|
||||
return
|
||||
}
|
||||
@ -42,10 +41,8 @@ func main() {
|
||||
if len(arg) < 3 {
|
||||
fmt.Println("The 'docs' command requires a module name as an argument: `slp docs [module]`")
|
||||
}
|
||||
fmt.Printf("Retrieving docs for %q", arg[2])
|
||||
err := operators.ReadDocs(arg[2])
|
||||
if err != nil {
|
||||
fmt.Println(" \033[31m- done\033[0m")
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ func Install(pkg string) error {
|
||||
for k, _ := range depList {
|
||||
fmt.Printf(" \033[2m├\033[0m staging %q\n", k)
|
||||
p := packages[k]
|
||||
repository, err := git.PlainClone(filepath.Join(stagingDir, k), false, &git.CloneOptions{
|
||||
repository, err := git.PlainClone(filepath.Join(stagingDir, p.Title), false, &git.CloneOptions{
|
||||
URL: p.Repository,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user