-
Notifications
You must be signed in to change notification settings - Fork 9
Add beast init for Issue 417
#426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kunrex
wants to merge
28
commits into
sdslabs:bl4ze/dev
Choose a base branch
from
kunrex:kunrex/minor/417
base: bl4ze/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
050ebbb
add beast init check in beast run
kunrex 19f2286
use core contants for paths
kunrex 89c2554
remove unused init and initDirectory from main
kunrex 37a558d
use os.IsNotExist
kunrex 1e6e332
add beast secrets dir
kunrex acf891d
add authorized keys
kunrex 3b64e8e
add beast example config file
kunrex 76ee086
rename detauklt auth keys file
kunrex 85a0954
add examples directory
kunrex c0a7330
add default beast db credentials
kunrex 560cf91
add beast init
kunrex 1b0e1a6
add prompt for database creation, add prompt for admin creation
kunrex d826e16
add docker pid check, change y\n prompt options
kunrex 4dd69d6
change created beast directory info message
kunrex b447c14
change beast directory not found commit message
kunrex 8abb133
add beast bootsteps complete and start beast server message
kunrex d579c3a
add ANSI sequence macros
kunrex 80fd0d2
add notification services to constants
kunrex ce1d947
add prompt utils
kunrex bf30b82
add prompting configuration through terminal
kunrex 1a17b55
add beast config command
kunrex da04eb7
change config command description
kunrex 831aa10
bug fixes on git config
kunrex 3d6fbf7
fix bugs in beast init
kunrex 0617f7a
add database prompt to beast config
kunrex b4eca23
add user friendly prompt for date time
kunrex 689db71
bug fixes on prompt date
kunrex 7c7b9c9
add warning instead of error on empty integer input
kunrex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,48 +1,9 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
| "path/filepath" | ||
|
|
||
| "github.com/sdslabs/beastv4/core" | ||
| _ "github.com/sdslabs/beastv4/core/database" | ||
|
|
||
| log "github.com/sirupsen/logrus" | ||
| ) | ||
|
|
||
| func initDirectory(dir string) { | ||
| if _, err := os.Stat(dir); err != nil { | ||
| if os.IsNotExist(err) { | ||
| if err = os.MkdirAll(dir, 0755); err != nil { | ||
| fmt.Println("Error occured while creating beast dir") | ||
| os.Exit(1) | ||
| } | ||
| } else { | ||
| fmt.Println("Error while checking beast dir stats, check permissions") | ||
| os.Exit(1) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| func init() { | ||
| // Check if the beast directory exist, if it does not exist then create it | ||
| // if an error occurs in between exit the utility printing the error. | ||
| initDirectory(core.BEAST_GLOBAL_DIR) | ||
| initDirectory(filepath.Join(core.BEAST_GLOBAL_DIR, core.BEAST_REMOTES_DIR)) | ||
| initDirectory(filepath.Join(core.BEAST_GLOBAL_DIR, core.BEAST_STAGING_DIR)) | ||
|
|
||
| // Setup logger for the application. | ||
| Formatter := new(log.TextFormatter) | ||
| Formatter.TimestampFormat = "02-01-2006 15:04:05" | ||
| Formatter.FullTimestamp = true | ||
|
|
||
| log.SetFormatter(Formatter) | ||
| log.SetLevel(log.WarnLevel) | ||
|
|
||
| log.Debug("Setting up logging complete for beast") | ||
| } | ||
|
|
||
| func main() { | ||
| Execute() | ||
| } |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.