Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
revert debug print, exit on meta file errors; commit shadow dir
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Apr 17, 2020
1 parent c62f184 commit c413650
Show file tree
Hide file tree
Showing 18 changed files with 684 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
/mvs
/cue.mod/pkg
/vendor
/.hof/
/dist/
97 changes: 97 additions & 0 deletions .hof/Cli/.goreleaser.yml
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"
8 changes: 8 additions & 0 deletions .hof/Cli/ci/docker/Dockerfile.jessie
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
8 changes: 8 additions & 0 deletions .hof/Cli/ci/docker/Dockerfile.scratch
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
42 changes: 42 additions & 0 deletions .hof/Cli/commands/bash-completion.go
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)
}
65 changes: 65 additions & 0 deletions .hof/Cli/commands/convert.go
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)
}

},
}
37 changes: 37 additions & 0 deletions .hof/Cli/commands/graph.go
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)
}

},
}
39 changes: 39 additions & 0 deletions .hof/Cli/commands/hack.go
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)
}

},
}
48 changes: 48 additions & 0 deletions .hof/Cli/commands/info.go
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)

},
}
Loading

0 comments on commit c413650

Please sign in to comment.