mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-08-27 20:36:31 -04:00
Add helper function for retrieving home directory path
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get all packages in libmutton
|
||||
mapfile -s 1 -t packages < <(go list github.com/rwinkhart/libmutton/... 2>/dev/null | sed 's|github.com/rwinkhart/libmutton/||')
|
||||
|
||||
# If no packages found, exit
|
||||
if [ ${#packages[@]} -eq 0 ]; then
|
||||
echo "No packages found in libmutton"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Iterate through each package
|
||||
for package in "${packages[@]}"; do
|
||||
echo "- [ ] $package"
|
||||
mapfile -t lines < <(go doc -short "github.com/rwinkhart/libmutton/$package" 2>/dev/null | grep "func ")
|
||||
for line in "${lines[@]}"; do
|
||||
line="${line#"${line%%[![:space:]]*}"}"
|
||||
echo " - [ ] ${line:5}"
|
||||
done
|
||||
done
|
||||
@@ -4,6 +4,7 @@ package main
|
||||
// #include "types.h"
|
||||
import "C"
|
||||
import (
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/libmutton/global"
|
||||
)
|
||||
|
||||
@@ -82,3 +83,9 @@ func GetSSHDirPath() C.PascalString { return getPascalString(global.SSHDir) }
|
||||
//
|
||||
//export GetEntryRootPath
|
||||
func GetEntryRootPath() C.PascalString { return getPascalString(global.EntryRoot) }
|
||||
|
||||
// GetHomePath returns:
|
||||
// homePath
|
||||
//
|
||||
//export GetHomePath
|
||||
func GetHomePath() C.PascalString { return getPascalString(back.Home) }
|
||||
|
||||
@@ -3,6 +3,7 @@ module cmutton
|
||||
go 1.26rc3
|
||||
|
||||
require (
|
||||
github.com/rwinkhart/go-boilerplate v0.2.3-0.20260208035402-e1bb0012a781
|
||||
github.com/rwinkhart/libmutton v0.4.3-0.20260208054338-50cf92df616d
|
||||
github.com/rwinkhart/rcw v0.2.5
|
||||
)
|
||||
@@ -13,7 +14,6 @@ require (
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/pkg/sftp v1.13.10 // indirect
|
||||
github.com/pquerna/otp v1.5.0 // indirect
|
||||
github.com/rwinkhart/go-boilerplate v0.2.3-0.20260208035402-e1bb0012a781 // indirect
|
||||
github.com/rwinkhart/peercred-mini v0.1.2 // indirect
|
||||
golang.org/x/crypto v0.47.0 // indirect
|
||||
golang.org/x/sys v0.40.0 // indirect
|
||||
|
||||
Reference in New Issue
Block a user