Hello Solus Community!
I have been doing package updates for a little while now and started learning to program in Go (Golang) about two months ago. Now I have a little tool to share with you that I hope might come in handy...
I was getting tired of writing the whole url every time I went to download a repo and that led me to write a small program that you just run and put in the repo name as a command line argument and it then downloads it for you. I call it solfetch and I will be using it going forward. It might not be the best or well written program in the world but it gets the job done. I just thought I should share it here if anyone else would be interested π
Below is the code:
package main
import (
"flag"
"log"
"os/exec"
)
func main() {
flag.Parse()
var repo string = flag.Arg(0)
if repo == "" {
log.Fatalln("Usage: solfetch [repository name]")
}
path := "git clone https://dev.getsol.us/source/" + repo + ".git"
cmd := exec.Command("/bin/bash", "-c", path)
if err := cmd.Run(); err != nil {
log.Fatal(err, "\nSpecified repository doesn't exist or your internet connection is down")
}
}
Here is a link to download compiled binary if you don't want to compile it yourself:
https://github.com/Jacalz/go-projects/blob/master/projects/solus-packaging/solfetch?raw=true
Example of downloading brave:
./solfetch brave