This commit is contained in:
parent
aeff6a1d2a
commit
df836ae0c9
|
@ -16,14 +16,12 @@ package main
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"os"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"unsafe"
|
||||
"net/http"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
var cb C.callbackProc
|
||||
|
@ -50,17 +48,8 @@ func RVExtensionVersion(output *C.char, outputsize C.size_t) {
|
|||
C.strncpy(output, version, size)
|
||||
|
||||
// Load config
|
||||
const configPath string = "~/.a3web.conf"
|
||||
type Config struct {
|
||||
serverURL string `json:"serverURL"`
|
||||
}
|
||||
var config Config
|
||||
|
||||
if _, err := os.Stat(configPath); err == nil {
|
||||
configFile, _ := ioutil.ReadFile(configPath)
|
||||
json.Unmarshal(configFile, &config)
|
||||
serverURL = config.serverURL
|
||||
}
|
||||
flag.StringVar(&serverURL, "-a3webserver", "http://localhost:5000", "a string")
|
||||
flag.Parse()
|
||||
}
|
||||
|
||||
// RVExtensionArgs STRING callExtension ARRAY
|
||||
|
|
Loading…
Reference in New Issue