-
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.
Change -s logic to include complete profile and parsed config
- Loading branch information
Showing
4 changed files
with
12 additions
and
31 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,31 +1,15 @@ | ||
package util | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"sb/internal/log" | ||
"sb/internal/types" | ||
) | ||
|
||
func ShowConfig(context *types.Context, binaryName string) { | ||
localConfigPath, exists := LocalConfigPath(&context.Paths, binaryName) | ||
if !exists { | ||
log.LogInfoLn("Local Config not found, trying root config") | ||
path := filepath.Join(context.Paths.RootConfigPath, binaryName+".json") | ||
configExists, err := DoesPathExist(path) | ||
if err != nil { | ||
log.LogErr(err) | ||
} | ||
if configExists { | ||
log.LogHighlight(fmt.Sprintf("Root config found at path %v", path)) | ||
configJson := ParseJson(path) | ||
log.LogInfoLn(log.PrettyJson(configJson)) | ||
} | ||
} else { | ||
log.LogHighlight(fmt.Sprintf("Local config found at path %v", localConfigPath)) | ||
configJson := ParseJson(localConfigPath) | ||
log.LogInfoLn(log.PrettyJson(configJson)) | ||
} | ||
func ShowConfig(config *types.Config, profile string) { | ||
log.LogHighlight("\nSandbox profile which will be applied\n") | ||
log.LogInfoLn(profile) | ||
log.LogHighlight("\nConfig parsed from config files: \n") | ||
log.LogInfoLn(log.PrettyJson(config.SbConfig)) | ||
os.Exit(0) | ||
} |