Documentation ¶
Overview ¶
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package to decide what path is ment by some inputs, and also creates a label for them, if not set
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
collection of comands they can be used for any comand interpreter like cobra and ishell.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2020 Thomas Ziegler <thomas.zglr@googlemail.com>. All rights reserved.
Licensed under the MIT License ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- Variables
- func AddData(key string, data map[string]interface{})
- func AddJSON(key, jsonString string) error
- func AppendToPH(key, value string) bool
- func BashUser()
- func CallBackNewWs(newWs string)
- func CallBackOldWs(oldws string) bool
- func CheckOrCreateUseConfig(externalUseCase string) (string, error)
- func ClearAll()
- func ClearAllData()
- func CopyPlaceHolder2Origin()
- func CreateImport(path string, pathToAdd string) error
- func CtxOut(msg ...interface{})
- func DecidePath(searchWords, paths []string) (path string, found bool)
- func DirFind(args []string) string
- func DirFindApplyAndSave(args []string) (string, error)
- func ExecPathFile(waitGroup *sync.WaitGroup, useWaitGroup bool, template configure.RunConfig, ...) int
- func ExecuteScriptLine(ShellToUse string, cmdArg []string, command string, ...) (int, int, error)
- func ExecuteTemplateWorker(waitGroup *sync.WaitGroup, useWaitGroup bool, target string, ...)
- func ExistInStrMap(testStr string, check []string) bool
- func ExportTask(target string) (string, error)
- func ExportVarToFile(variable string, filename string) error
- func FindIndexByPath(path string) (index string, ok bool)
- func FindPwrShellProfile() (bool, string)
- func FindTemplate() (string, bool)
- func FindWorkspaceInfoByTemplate(...) (allCount int, updatedCount int)
- func FishCompletionUpdate(cmd *cobra.Command)
- func FishFunctionUpdate()
- func FishUpdate(cmd *cobra.Command)
- func GetAllTargets() ([]string, bool)
- func GetArgQuotedEntries(oristr string) ([]string, bool)
- func GetColorEnabled() bool
- func GetContxtBasePath() (string, error)
- func GetData(key string) (bool, map[string]interface{})
- func GetDataAsJson(key string) (bool, string)
- func GetDataAsYaml(key string) (bool, string)
- func GetDataKeys() []string
- func GetDefaultCmd() string
- func GetDefaultCmdOpts(ShellToUse string, cmdArg []string) []string
- func GetExecDefaults() (string, []string)
- func GetJSONPathResult(key, path string) (gjson.Result, bool)
- func GetJSONPathValueString(key, path string) string
- func GetLogger() *logrus.Logger
- func GetOriginMap() map[string]interface{}
- func GetPH(key string) string
- func GetPHExists(key string) (string, bool)
- func GetParsedTemplateSource(path string) (string, error)
- func GetPlaceHoldersFnc(inspectFunc func(phKey string, phValue string))
- func GetPwdTemplate(path string) (configure.RunConfig, error)
- func GetSharedPath(sharedName string) (string, error)
- func GetTemplate() (configure.RunConfig, string, bool, error)
- func GetUseInfo(usecase, _ string) (string, string)
- func HandleJSONMap(tmpl string, m map[string]interface{}) (string, error)
- func HandlePlaceHolder(line string) string
- func HandlePlaceHolderWithScope(line string, scopeVars map[string]string) string
- func HandleUsecase(externalUseCase string) string
- func ImportDataFromJSONFile(key string, filename string) error
- func ImportDataFromYAMLFile(key string, filename string) error
- func ImportFileContent(filename string) (string, error)
- func ImportFolder(path string, _ string) (map[string]interface{}, error)
- func ImportFolders(templatePath string, paths ...string) (string, error)
- func ImportJSONFile(fileName string) (map[string]interface{}, error)
- func ImportYAMLFile(filename string) (map[string]interface{}, error)
- func InitDefaultVars()
- func InitWsVariables()
- func LintOut(leftcnt, rightcnt int, all bool, noOut bool) bool
- func ListUseCases(fullPath bool) ([]string, error)
- func LoadIncTempalte(path string) (string, bool)
- func MainExecute()
- func MainInit()
- func MergeVariableMap(mapin map[string]interface{}, maporigin map[string]interface{}) map[string]interface{}
- func ParseFileAsTemplate(path string) (string, error)
- func PrintCnPaths()
- func PwrShellCompletionUpdate(cmd *cobra.Command)
- func PwrShellExec(cmd string) string
- func PwrShellForceCreateProfile()
- func PwrShellTestProfile() bool
- func PwrShellUpdate(cmd *cobra.Command)
- func PwrShellUser()
- func ResetAllTaskInfos()
- func ResetVariables()
- func RunShared(targets string)
- func RunTargets(targets string, sharedRun bool)
- func SetColorEnabled(enabled bool)
- func SetIfNotExists(key, value string)
- func SetJSONValueByPath(key, path, value string) error
- func SetPH(key, value string)
- func SharedFolderExecuter(template configure.RunConfig, locationHandle func(string, string))
- func ShowAsYaml(fullparsed bool, trySupress bool, indent int)
- func ShowPaths(current string)
- func SplitArgs(cmdList []string, prefix string, arghandler func(string, map[string]string)) []string
- func SplitQuoted(oristr string, sep string) []string
- func StringMatchTest(pattern, value string) bool
- func StringSplitArgs(argLine string, prefix string) (string, map[string]string)
- func StripContxtUseDir(path string) string
- func TaskExists(target string) bool
- func TaskRunning(target string) bool
- func TaskRunsAtLeast(target string, atLeast int) bool
- func TestTemplate() error
- func TryParse(script []string, regularScript func(string) (bool, int)) (bool, int, []string)
- func UpdateOriginMap(mapData map[string]interface{})
- func UpdateUseCase(fullPath string)
- func UserDirectory() (string, error)
- func WaitForTasksDone(tasks []string, timeOut, tickTime time.Duration, stillWait func() bool, ...)
- func WriteTemplate()
- func YAMLToMap(source string) (map[string]interface{}, error)
- func ZshFuncDir() string
- func ZshUpdate(cmd *cobra.Command)
- func ZshUser()
- type CtxOutCtrl
- type CtxOutLabel
- type CtxTargetOut
- type CtxUi
- func (ui *CtxUi) CreatePathSelectPage() *tview.Flex
- func (ui *CtxUi) CreateRunPage() *tview.Flex
- func (ui *CtxUi) CreateWorkSpacePage() *tview.Flex
- func (ui *CtxUi) FilterOutPut(caseHandle func(target string, msg []interface{}), msg ...interface{}) []interface{}
- func (ui *CtxUi) UpdateAll()
- func (ui *CtxUi) UpdatePathList()
- type EventScriptLine
- type EventTaskStatus
- type TaskDef
Constants ¶
const ( EventAllLines = "ExecuteScriptLine" // EventAllLines is the event name for sending all lines EventTaskStatusUpdate = "TaskStatus" // EventTaskStatusUpdate is the event name for sending task status updates )
const ( // DefaultExecFile is the filename of the script defaut file DefaultExecFile = string(os.PathSeparator) + ".context.json" // DefaultExecYaml is the default yaml configuration file DefaultExecYaml = string(os.PathSeparator) + ".contxt.yml" // TargetScript is script default target TargetScript = "script" // InitScript is script default target InitScript = "init" // ClearScript is script default target ClearScript = "clear" // TestScript is teh test target TestScript = "test" // DefaultCommandFallBack is used if no command is defined DefaultCommandFallBack = "bash" // On windows we have a different default DefaultCommandFallBackWindows = "powershell" )
const ( PWRSHELL_CMD_VERSION = "$PSVersionTable.PSVersion.Major" // powershell cmd to get actual version PWRSHELL_CMD_PROFILE = "$PROFILE" // powershell cmd to get actual profile PWRSHELL_CMD_TEST_PROFILE = `Test-Path -Path $PROFILE.CurrentUserCurrentHost` // powershell cmd to test if profile exists PWRSHELL_CMD_PROFILE_CREATE = `New-Item -Path $PROFILE.CurrentUserCurrentHost -ItemType File -Force` // powershell cmd to create profile )
Variables ¶
var PreHook func(msg ...interface{}) bool = nil
Functions ¶
func AppendToPH ¶
func CallBackNewWs ¶
func CallBackNewWs(newWs string)
func CallBackOldWs ¶
func CheckOrCreateUseConfig ¶
CheckOrCreateUseConfig get a usecase like swaros/ctx-git and checks if a local copy of them exists. if they not exists it creates the local directoy and uses git to clone the content. afterwards it writes a version.conf in the forlder above of content and stores the current hashes
func CopyPlaceHolder2Origin ¶
func CopyPlaceHolder2Origin()
copies the placeholder to the origin map so there can be used in templates to this should be done after initilize the application. but not while runtime
func CreateImport ¶
CreateImport creates import settings
func DecidePath ¶
func DirFind ¶
DirFind returns the best matching part of depending the arguments, what of the stored paths would be the expected one
func DirFindApplyAndSave ¶
func ExecPathFile ¶
func ExecPathFile(waitGroup *sync.WaitGroup, useWaitGroup bool, template configure.RunConfig, target string) int
ExecPathFile executes the default exec file
func ExecuteScriptLine ¶
func ExecuteScriptLine(ShellToUse string, cmdArg []string, command string, callback func(string, error) bool, startInfo func(*os.Process)) (int, int, error)
ExecuteScriptLine executes a simple shell script returns internal exitsCode, process existcode, error
func ExecuteTemplateWorker ¶
func ExecuteTemplateWorker(waitGroup *sync.WaitGroup, useWaitGroup bool, target string, template configure.RunConfig)
ExecuteTemplateWorker runs ExecCurrentPathTemplate in context of a waitgroup
func ExistInStrMap ¶
func ExportTask ¶
func ExportVarToFile ¶
func FindIndexByPath ¶
func FindPwrShellProfile ¶
func FindTemplate ¶
FindTemplate searchs for Template files in different spaces
func FindWorkspaceInfoByTemplate ¶
func FindWorkspaceInfoByTemplate(updateFn func(workspace string, cnt int, update bool, info configure.WorkspaceInfoV2)) (allCount int, updatedCount int)
FindWorkspaceInfoByTemplate is searching for a template file and if found, it will set the project and role from the template file to the workspace info this is only done if the workspace info is not set yet this is automatically done on each workspace, if the workspace is not set yet but only on the command switch and 'dir add'
func FishCompletionUpdate ¶
FishCompletionUpdate updates the fish completion file
func FishFunctionUpdate ¶
func FishFunctionUpdate()
func FishUpdate ¶
FishFunctionUpdate updates the fish function file and adds code completion for the fish shell
func GetAllTargets ¶
func GetArgQuotedEntries ¶
func GetColorEnabled ¶
func GetColorEnabled() bool
func GetContxtBasePath ¶
GetContxtBasePath returns the full path to the contxt base directory
func GetDataAsJson ¶
GetDataAsJson converts the map given by key infto a yaml string
func GetDataAsYaml ¶
GetDataAsYaml converts the map given by key infto a yaml string
func GetDefaultCmd ¶
func GetDefaultCmd() string
func GetDefaultCmdOpts ¶
func GetExecDefaults ¶
func GetJSONPathResult ¶
GetJSONPathResult returns the value depending key and path as string
func GetJSONPathValueString ¶
GetJSONPathValueString returns the value depending key and path as string
func GetOriginMap ¶
func GetOriginMap() map[string]interface{}
func GetPH ¶
GetPH the content of the key. but at least a empty string if not exists. so this is not usefull to test if the PH was set.
func GetPHExists ¶
GetPH the content of the key as string. if exists.
func GetParsedTemplateSource ¶
GetParsedTemplateSource Returns the soucecode of the template including parsing placeholders
func GetPlaceHoldersFnc ¶
func GetPwdTemplate ¶
GetPwdTemplate returns the template path if exists. it also parses the content of the template against imports and handles them
func GetSharedPath ¶
GetSharedPath returns the full path to the shared repository
func GetTemplate ¶
GetTemplate return current template, the absolute path,if it exists, any error
func GetUseInfo ¶
func HandleJSONMap ¶
HandleJSONMap parsing json content for text/template
func HandlePlaceHolder ¶
HandlePlaceHolder replaces all defined placeholders
func HandleUsecase ¶
func ImportDataFromJSONFile ¶
ImportDataFromJSONFile imports a map from a json file and assign it to a key
func ImportDataFromYAMLFile ¶
ImportDataFromYAMLFile imports a map from a json file and assign it to a key
func ImportFileContent ¶
ImportFileContent imports a file and returns content as string
func ImportFolder ¶
ImportFolder reads folder recursiv and reads all .json, .yml and .yaml files
func ImportFolders ¶
ImportFolders import a list of folders recusiv
func ImportJSONFile ¶
ImportJSONFile imports a json file for reading
func ImportYAMLFile ¶
ImportYAMLFile imports a yaml file as used for json map
func InitDefaultVars ¶
func InitDefaultVars()
func InitWsVariables ¶
func InitWsVariables()
InitWsVariables is setting up variables depending the current found configuration (.contxt.yml)
func LintOut ¶
LintOut prints the source code and the parsed content in a table view, and marks configured and not configured entries with dfferent colors
func ListUseCases ¶
func LoadIncTempalte ¶
LoadIncTempalte check if .inc.contxt.yml files exists and if this is the case the content will be loaded and all defined paths used to get values for parsing the template file
func MainInit ¶
func MainInit()
MainInit initilaize the Application. this is required for any entrie-point currently we have two of them. by running in interactive in ishell, and by running with parameters.
func MergeVariableMap ¶
func MergeVariableMap(mapin map[string]interface{}, maporigin map[string]interface{}) map[string]interface{}
MergeVariableMap merges two maps
func ParseFileAsTemplate ¶
func PrintCnPaths ¶
func PrintCnPaths()
func PwrShellExec ¶
func PwrShellForceCreateProfile ¶
func PwrShellForceCreateProfile()
func PwrShellTestProfile ¶
func PwrShellTestProfile() bool
func PwrShellUpdate ¶
func PwrShellUser ¶
func PwrShellUser()
func ResetVariables ¶
func ResetVariables()
func RunTargets ¶
RunTargets executes multiple targets the targets string can have multiple targets seperated by comma
func SetColorEnabled ¶
func SetColorEnabled(enabled bool)
func SetIfNotExists ¶
func SetIfNotExists(key, value string)
func SetJSONValueByPath ¶
func SharedFolderExecuter ¶
SharedFolderExecuter runs shared .contxt.yml files directly without merging them into the current contxt file
func ShowAsYaml ¶
ShowAsYaml prints the generated source of the task file
func ShowPaths ¶
func ShowPaths(current string)
ShowPaths : display all stored paths in the workspace
func SplitQuoted ¶
func StringMatchTest ¶
StringMatchTest test a pattern and a value. in this example: myvar: "=hello" the patter is "=hello" and the value should be "hello" for a match
func StringSplitArgs ¶
func StripContxtUseDir ¶
func TaskExists ¶
TaskExists checks if a task is already created
func TaskRunning ¶
TaskRunning checks if a task is already running
func TaskRunsAtLeast ¶
checks if a task was at least started X times
func TestTemplate ¶
func TestTemplate() error
func UpdateOriginMap ¶
func UpdateOriginMap(mapData map[string]interface{})
UpdateOriginMap updates the main templating map with an new one
func UpdateUseCase ¶
func UpdateUseCase(fullPath string)
func UserDirectory ¶
func WaitForTasksDone ¶
func WaitForTasksDone(tasks []string, timeOut, tickTime time.Duration, stillWait func() bool, isDone func(), timeOutHandle func(), notStartet func(string, string, map[string]string) bool)
WaitForTasksDone waits until all the task are done triggers a callback for any tick and one if the state DONE is reached there is an timeout as maximum time to wait if this time is reached the process will be continued and the timeout callback is triggered the callback for notStarted must return true if they handle this issue. on returning false it will be counted as isDone
func ZshFuncDir ¶
func ZshFuncDir() string
try to get the best path by reading the permission because zsh seems not be used in windows, we stick to linux related permission check
Types ¶
type CtxOutCtrl ¶
type CtxOutCtrl struct {
IgnoreCase bool
}
type CtxOutLabel ¶
type CtxOutLabel struct { Message interface{} FColor string }
func InfoF ¶
func InfoF(val interface{}) CtxOutLabel
func InfoMinor ¶
func InfoMinor(val interface{}) CtxOutLabel
func InfoRed ¶
func InfoRed(val interface{}) CtxOutLabel
func LabelErrF ¶
func LabelErrF(val interface{}) CtxOutLabel
func LabelFY ¶
func LabelFY(val interface{}) CtxOutLabel
func LabelOkF ¶
func LabelOkF(val interface{}) CtxOutLabel
func ValF ¶
func ValF(val interface{}) CtxOutLabel
type CtxTargetOut ¶
type CtxUi ¶
type CtxUi struct { LogOutMessage string // contains filtered or unexported fields }
func (*CtxUi) CreatePathSelectPage ¶
func (*CtxUi) CreateRunPage ¶
CreateRunPage builds the page that contains different elements to inspect and run the targets
func (*CtxUi) CreateWorkSpacePage ¶
func (*CtxUi) FilterOutPut ¶
func (ui *CtxUi) FilterOutPut(caseHandle func(target string, msg []interface{}), msg ...interface{}) []interface{}
FilterOutPut parses the content and handles all interface depending the Type differently
func (*CtxUi) UpdatePathList ¶
func (ui *CtxUi) UpdatePathList()