-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from DopplerHQ/andre/tui
TUI Beta
- Loading branch information
Showing
30 changed files
with
2,571 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright © 2020 Doppler <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"github.com/DopplerHQ/cli/pkg/configuration" | ||
tuiApp "github.com/DopplerHQ/cli/pkg/tui" | ||
"github.com/DopplerHQ/cli/pkg/utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var tuiCmd = &cobra.Command{ | ||
Use: "tui", | ||
Short: "Launch TUI (BETA)", | ||
Args: cobra.NoArgs, | ||
Run: tui, | ||
} | ||
|
||
func tui(cmd *cobra.Command, args []string) { | ||
localConfig := configuration.LocalConfig(cmd) | ||
tuiApp.Start(localConfig) | ||
} | ||
|
||
func init() { | ||
tuiCmd.Flags().StringP("project", "p", "", "project (e.g. backend)") | ||
tuiCmd.Flags().StringP("config", "c", "", "config (e.g. dev)") | ||
tuiCmd.Flags().BoolVar(&utils.DebugTUI, "debug-tui", utils.DebugTUI, "log TUI messages to file") | ||
rootCmd.AddCommand(tuiCmd) | ||
} |
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,27 @@ | ||
/* | ||
Copyright © 2023 Doppler <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package configuration | ||
|
||
var CURRENT_INTRO_VERSION = 1 | ||
|
||
func TUIShouldShowIntro() bool { | ||
return configContents.TUI.IntroVersionSeen != CURRENT_INTRO_VERSION | ||
} | ||
|
||
func TUIMarkIntroSeen() { | ||
configContents.TUI.IntroVersionSeen = CURRENT_INTRO_VERSION | ||
writeConfig(configContents) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
Copyright © 2023 Doppler <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package common | ||
|
||
import ( | ||
"github.com/DopplerHQ/cli/pkg/models" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// Commonly used things wrapped into one struct for convenience when passing it around | ||
type Common struct { | ||
Log *logrus.Entry | ||
Opts models.ScopedOptions | ||
} | ||
|
||
func NewCommon(opts models.ScopedOptions) (*Common, error) { | ||
return &Common{ | ||
Log: newLogger(), | ||
Opts: opts, | ||
}, nil | ||
} |
Oops, something went wrong.