-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lou Marvin Caraig <[email protected]>
- Loading branch information
1 parent
695ad46
commit c8ea9c2
Showing
2 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/se7entyse7en/pydockenv/internal/environment" | ||
"github.com/se7entyse7en/pydockenv/log" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var deactivateCmd = &cobra.Command{ | ||
Use: "deactivate", | ||
Short: "Deactivate the current virtual environment", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
logger := log.Logger | ||
err := log.SetupLogger(cmd) | ||
if err != nil { | ||
logger.WithError(err).Fatal("Cannot setup logger") | ||
} | ||
|
||
logger.Info("Deactivating virtual environment...") | ||
|
||
if err := environment.Deactivate(); err != nil { | ||
logger.WithError(err).Fatal("Cannot deactivate virtual environment") | ||
} | ||
|
||
logger.Info("Virtual environment deactivated!") | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(deactivateCmd) | ||
} |
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