-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,251 additions
and
1,068 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/bearer/bearer/cmd/bearer/build" | ||
"github.com/bearer/bearer/internal/commands" | ||
"github.com/bearer/bearer/external/run" | ||
) | ||
|
||
func main() { | ||
app := commands.NewApp(build.Version, build.CommitSHA) | ||
if err := app.Execute(); err != nil { | ||
// error messages are printed by the framework | ||
os.Exit(1) | ||
} | ||
run.Run(build.Version, build.CommitSHA, run.NewEngine(run.DefaultLanguages())) | ||
} |
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,32 @@ | ||
package run | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/bearer/bearer/internal/commands" | ||
"github.com/bearer/bearer/internal/engine" | ||
engineimpl "github.com/bearer/bearer/internal/engine/implementation" | ||
"github.com/bearer/bearer/internal/languages" | ||
"github.com/bearer/bearer/internal/scanner/language" | ||
) | ||
|
||
type Language = language.Language | ||
type Engine = engine.Engine | ||
|
||
func NewEngine(languages []Language) Engine { | ||
return engineimpl.New(languages) | ||
} | ||
|
||
func DefaultLanguages() []Language { | ||
return languages.Default() | ||
} | ||
|
||
func Run(version, commitSHA string, engine Engine) { | ||
err := commands.NewApp(version, commitSHA, engine).Execute() | ||
engine.Close() | ||
|
||
if err != nil { | ||
// error messages are printed by the framework | ||
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
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
Oops, something went wrong.