mirror of
https://github.com/felixangell/phi.git
synced 2024-10-26 17:18:31 +03:00
Merge pull request #42 from Chyroc/add/cross-compile
This commit is contained in:
commit
e3ca29a5e1
@ -3,9 +3,7 @@ package cfg
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TomlConfig struct {
|
type TomlConfig struct {
|
||||||
@ -33,22 +31,6 @@ type FileAssociations struct {
|
|||||||
Extensions []string
|
Extensions []string
|
||||||
}
|
}
|
||||||
|
|
||||||
var DEFUALT_TOML_CONFIG string = getDefaultConfig()
|
|
||||||
|
|
||||||
func getDefaultConfig() string {
|
|
||||||
switch strings.ToLower(runtime.GOOS) {
|
|
||||||
case "windows":
|
|
||||||
return DEFAULT_WINDOWS_TOML_CONFIG
|
|
||||||
case "linux":
|
|
||||||
return DEFAULT_LINUX_TOML_CONFIG
|
|
||||||
case "darwin":
|
|
||||||
return DEFAULT_MAC_TOML_CONFIG
|
|
||||||
}
|
|
||||||
|
|
||||||
// fallback is a windows config.
|
|
||||||
return DEFAULT_WINDOWS_TOML_CONFIG
|
|
||||||
}
|
|
||||||
|
|
||||||
type SyntaxCriteria struct {
|
type SyntaxCriteria struct {
|
||||||
Colour int `toml:"colouring"`
|
Colour int `toml:"colouring"`
|
||||||
Match []string `toml:"match"`
|
Match []string `toml:"match"`
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
// +build !linux,!darwin
|
||||||
|
|
||||||
package cfg
|
package cfg
|
||||||
|
|
||||||
var DEFAULT_WINDOWS_TOML_CONFIG string = `[editor]
|
var DEFUALT_TOML_CONFIG = `[editor]
|
||||||
tab_size = 4
|
tab_size = 4
|
||||||
hungry_backspace = true
|
hungry_backspace = true
|
||||||
tabs_are_spaces = true
|
tabs_are_spaces = true
|
@ -1,6 +1,8 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package cfg
|
package cfg
|
||||||
|
|
||||||
var DEFAULT_LINUX_TOML_CONFIG string = `[editor]
|
var DEFUALT_TOML_CONFIG = `[editor]
|
||||||
tab_size = 4
|
tab_size = 4
|
||||||
hungry_backspace = true
|
hungry_backspace = true
|
||||||
tabs_are_spaces = true
|
tabs_are_spaces = true
|
@ -1,6 +1,8 @@
|
|||||||
|
// +build darwin
|
||||||
|
|
||||||
package cfg
|
package cfg
|
||||||
|
|
||||||
var DEFAULT_MAC_TOML_CONFIG string = `[editor]
|
var DEFUALT_TOML_CONFIG = `[editor]
|
||||||
tab_size = 4
|
tab_size = 4
|
||||||
hungry_backspace = true
|
hungry_backspace = true
|
||||||
tabs_are_spaces = true
|
tabs_are_spaces = true
|
Loading…
Reference in New Issue
Block a user