Initial commit
This commit is contained in:
2
.envrc
Normal file
2
.envrc
Normal file
@@ -0,0 +1,2 @@
|
||||
export GUIX_PROFILE="$HOME/.guix-extra-profiles/go-build/go-build"
|
||||
source "$GUIX_PROFILE/etc/profile"
|
||||
35
main.go
Normal file
35
main.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
reader := bufio.NewScanner(os.Stdin)
|
||||
if !reader.Scan() {
|
||||
if reader.Err() != nil {
|
||||
fmt.Fprintf(os.Stderr, "No input detected")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
line := reader.Text()
|
||||
|
||||
uri, err := url.Parse(line)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failed to parse input: %s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
user := uri.User.Username()
|
||||
pw, _ := uri.User.Password()
|
||||
host := uri.Host
|
||||
db := uri.EscapedPath()
|
||||
|
||||
fmt.Printf("export PGUSER=%s\n", user)
|
||||
fmt.Printf("export PGPASSWORD=%s\n", pw)
|
||||
fmt.Printf("export PGHOST=%s\n", host)
|
||||
fmt.Printf("export PGDATABASE=%s\n", db)
|
||||
}
|
||||
8
manifest.scm
Normal file
8
manifest.scm
Normal file
@@ -0,0 +1,8 @@
|
||||
(specifications->manifest
|
||||
'(
|
||||
"go@1.21"
|
||||
"git"
|
||||
"bash"
|
||||
"glibc-locales"
|
||||
"nss-certs"
|
||||
"curl"))
|
||||
Reference in New Issue
Block a user