Skip to content

Commit 1689945

Browse files
committed
fixed conflicts in main
1 parent 5a4ad5f commit 1689945

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

main.go

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ package main
66
import (
77
"flag"
88
"os"
9-
"os/user"
109
"path/filepath"
1110
"runtime/debug"
1211
"strconv"
1312
"text/template"
1413
"time"
1514

1615
log "github.com/Sirupsen/logrus"
17-
<<<<<<< e73846650fde9b0955aa35e237100ec552af47fb
18-
=======
16+
1917
"github.com/arduino/arduino-create-agent/tools"
20-
"github.com/carlescere/scheduler"
21-
>>>>>>> Move initialization of tools in package tools
2218
"github.com/gin-gonic/gin"
2319
"github.com/itsjamie/gin-cors"
2420
"github.com/kardianos/osext"
@@ -39,16 +35,15 @@ var (
3935
gcType = flag.String("gc", "std", "Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)")
4036
logDump = flag.String("log", "off", "off = (default)")
4137
// hostname. allow user to override, otherwise we look it up
42-
hostname = flag.String("hostname", "unknown-hostname", "Override the hostname we get from the OS")
43-
updateUrl = flag.String("updateUrl", "", "")
44-
appName = flag.String("appName", "", "")
45-
genCert = flag.Bool("generateCert", false, "")
46-
port string
47-
portSSL string
48-
origins = flag.String("origins", "", "Allowed origin list for CORS")
49-
address = flag.String("address", "127.0.0.1", "The address where to listen. Defaults to localhost")
50-
indexURL = flag.String("indexURL", "http://downloads.arduino.cc/packages/package_index.json", "The address from where to download the index json containing the location of upload tools")
51-
Tools tools.Tools
38+
hostname = flag.String("hostname", "unknown-hostname", "Override the hostname we get from the OS")
39+
updateUrl = flag.String("updateUrl", "", "")
40+
appName = flag.String("appName", "", "")
41+
genCert = flag.Bool("generateCert", false, "")
42+
globalToolsMap = make(map[string]string)
43+
port string
44+
portSSL string
45+
origins = flag.String("origins", "", "Allowed origin list for CORS")
46+
address = flag.String("address", "127.0.0.1", "The address where to listen. Defaults to localhost")
5247
)
5348

5449
type NullWriter int
@@ -91,15 +86,7 @@ func main() {
9186
src, _ := osext.Executable()
9287
dest := filepath.Dir(src)
9388

94-
// Instantiate Tools
95-
usr, _ := user.Current()
96-
directory := usr.HomeDir + "/.arduino-create"
97-
Tools = tools.Tools{
98-
Directory: directory,
99-
IndexURL: *indexURL,
100-
Logger: log.New(),
101-
}
102-
Tools.Init()
89+
tools.CreateDir()
10390

10491
if embedded_autoextract {
10592
// save the config.ini (if it exists)

0 commit comments

Comments
 (0)