-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Create a new compliance-masonry executable for legacy uses - New masonry.go is now the primary program naming - Fixes #177
- Loading branch information
1 parent
553bce0
commit f4728e7
Showing
10 changed files
with
67 additions
and
19 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
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
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
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 |
---|---|---|
@@ -1,14 +1,39 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/opencontrol/compliance-masonry/pkg/cmd/masonry" | ||
"os/exec" | ||
"path/filepath" | ||
"runtime" | ||
) | ||
|
||
func main() { | ||
if err := masonry.Run(); err != nil { | ||
os.Exit(1) | ||
var binary string | ||
var cmd *exec.Cmd | ||
|
||
if runtime.GOOS == "windows" { | ||
binary = "masonry.exe" | ||
} else { | ||
binary = "masonry" | ||
} | ||
|
||
prog, err := filepath.Abs(filepath.Join(binary)) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
args := os.Args | ||
if len(args) > 1 { | ||
cmd = exec.Command(prog, args[1:]...) | ||
} else { | ||
cmd = exec.Command(prog) | ||
} | ||
|
||
output, err := cmd.CombinedOutput() | ||
if err != nil { | ||
//do nothing | ||
} | ||
os.Exit(0) | ||
fmt.Printf("%s\n", output) | ||
} |
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,14 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/opencontrol/compliance-masonry/pkg/cmd/masonry" | ||
) | ||
|
||
func main() { | ||
if err := masonry.Run(); err != nil { | ||
os.Exit(1) | ||
} | ||
os.Exit(0) | ||
} |
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
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
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
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
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