This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert debug print, exit on meta file errors; commit shadow dir
- Loading branch information
Showing
18 changed files
with
684 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,4 @@ | |
/mvs | ||
/cue.mod/pkg | ||
/vendor | ||
/.hof/ | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
project_name: "mvs" | ||
|
||
before: | ||
hooks: | ||
- go mod vendor | ||
|
||
builds: | ||
- binary: "mvs" | ||
main: main.go | ||
|
||
ldflags: | ||
- -s -w | ||
- -X github.com/hofstadter-io/mvs/commands.Version={{.Version}} | ||
- -X github.com/hofstadter-io/mvs/commands.Commit={{.FullCommit}} | ||
- -X github.com/hofstadter-io/mvs/commands.BuildDate={{.Date}} | ||
- -X github.com/hofstadter-io/mvs/commands.GoVersion=go1.14 | ||
- -X github.com/hofstadter-io/mvs/commands.BuildOS={{.Os}} | ||
- -X github.com/hofstadter-io/mvs/commands.BuildArch={{.Arch}} | ||
- -X github.com/hofstadter-io/mvs/commands.BuildArm={{.Arm}} | ||
|
||
env: | ||
- CGO_ENABLED=0 | ||
|
||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
|
||
ignore: | ||
- goos: linux | ||
goarch: arm | ||
|
||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}" | ||
|
||
archives: | ||
- format: binary | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
amd64: x86_64 | ||
# Needed hack for binary only uploads | ||
# For more information, check #602 | ||
files: | ||
- "thisfiledoesnotexist*" | ||
|
||
|
||
checksum: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
|
||
release: | ||
disable: true | ||
draft: false | ||
github: | ||
owner: hofstadter-io | ||
name: mvs | ||
|
||
dockers: | ||
- binaries: | ||
- mvs | ||
skip_push: false | ||
dockerfile: ci/docker/Dockerfile.jessie | ||
image_templates: | ||
- "hofstadter/{{.ProjectName}}:{{.Tag}}" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}" | ||
- "hofstadter/{{.ProjectName}}:latest" | ||
|
||
- "hofstadter/{{.ProjectName}}:{{.Tag}}-debian" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-debian" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-debian" | ||
- "hofstadter/{{.ProjectName}}:latest-debian" | ||
|
||
|
||
- binaries: | ||
- mvs | ||
skip_push: false | ||
dockerfile: ci/docker/Dockerfile.scratch | ||
image_templates: | ||
- "hofstadter/{{.ProjectName}}:{{.Tag}}-scratch" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-scratch" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-scratch" | ||
- "hofstadter/{{.ProjectName}}:latest-scratch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM debian:jessie | ||
MAINTAINER Hofstadter, Inc <open-source@hofstadter.io> | ||
|
||
COPY mvs /usr/bin/local | ||
ENTRYPOINT ["mvs"] | ||
|
||
VOLUME ["/work"] | ||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM scratch | ||
MAINTAINER Hofstadter, Inc <open-source@hofstadter.io> | ||
|
||
COPY mvs / | ||
ENTRYPOINT ["/mvs"] | ||
|
||
VOLUME ["/work"] | ||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package commands | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var BashCompletionLong = `Generate Bash completions | ||
To load completion run | ||
. <(mvs bash) | ||
To configure your bash shell to load completions for each session add to your bashrc | ||
# ~/.bashrc or ~/.profile | ||
. <(mvs bash) | ||
` | ||
|
||
var BashCompletionCmd = &cobra.Command{ | ||
|
||
Use: "bash-completion", | ||
|
||
Aliases: []string{ | ||
"bash", | ||
"completions", | ||
}, | ||
|
||
Short: "Generate Bash completions", | ||
|
||
Long: BashCompletionLong, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
RootCmd.GenBashCompletion(os.Stdout) | ||
}, | ||
} | ||
|
||
func init() { | ||
RootCmd.AddCommand(BashCompletionCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package commands | ||
|
||
import ( | ||
|
||
// hello... something might need to go here | ||
|
||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"fmt" | ||
|
||
"github.com/hofstadter-io/mvs/lib" | ||
) | ||
|
||
var convertLong = `convert another package system to MVS.` | ||
|
||
var ConvertCmd = &cobra.Command{ | ||
|
||
Use: "convert <lang> <file>", | ||
|
||
Short: "convert another package system to MVS.", | ||
|
||
Long: convertLong, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
// Argument Parsing | ||
|
||
if 0 >= len(args) { | ||
fmt.Println("missing required argument: 'Lang'") | ||
cmd.Usage() | ||
os.Exit(1) | ||
} | ||
|
||
var lang string | ||
|
||
if 0 < len(args) { | ||
|
||
lang = args[0] | ||
|
||
} | ||
|
||
if 1 >= len(args) { | ||
fmt.Println("missing required argument: 'Filename'") | ||
cmd.Usage() | ||
os.Exit(1) | ||
} | ||
|
||
var filename string | ||
|
||
if 1 < len(args) { | ||
|
||
filename = args[1] | ||
|
||
} | ||
|
||
err := lib.Convert(lang, filename) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package commands | ||
|
||
import ( | ||
|
||
// hello... something might need to go here | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"fmt" | ||
|
||
"os" | ||
|
||
"github.com/hofstadter-io/mvs/lib" | ||
) | ||
|
||
var graphLong = `print module requirement graph` | ||
|
||
var GraphCmd = &cobra.Command{ | ||
|
||
Use: "graph", | ||
|
||
Short: "print module requirement graph", | ||
|
||
Long: graphLong, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
// Argument Parsing | ||
|
||
err := lib.ProcessLangs("graph", args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package commands | ||
|
||
import ( | ||
|
||
// hello... something might need to go here | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"fmt" | ||
|
||
"os" | ||
|
||
"github.com/hofstadter-io/mvs/lib" | ||
) | ||
|
||
var hackLong = `dev command` | ||
|
||
var HackCmd = &cobra.Command{ | ||
|
||
Use: "hack", | ||
|
||
Hidden: true, | ||
|
||
Short: "dev command", | ||
|
||
Long: hackLong, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
// Argument Parsing | ||
|
||
err := lib.Hack("", args) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package commands | ||
|
||
import ( | ||
|
||
// hello... something might need to go here | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"fmt" | ||
|
||
"os" | ||
|
||
"github.com/hofstadter-io/mvs/lib" | ||
) | ||
|
||
var infoLong = ` print info about languages and modders known to mvs | ||
- no arg prints a list of known languages | ||
- an arg prints info about the language modder configuration that would be used` | ||
|
||
var InfoCmd = &cobra.Command{ | ||
|
||
Use: "info [language]", | ||
|
||
Short: "print info about languages and modders known to mvs", | ||
|
||
Long: infoLong, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
// Argument Parsing | ||
|
||
var lang string | ||
|
||
if 0 < len(args) { | ||
|
||
lang = args[0] | ||
|
||
} | ||
|
||
msg, err := lib.LangInfo(lang) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
fmt.Println(msg) | ||
|
||
}, | ||
} |
Oops, something went wrong.