Skip to content

Commit

Permalink
feat: support express
Browse files Browse the repository at this point in the history
  • Loading branch information
fredliang44 committed May 24, 2022
1 parent e0ec2a0 commit fe5c670
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
34 changes: 17 additions & 17 deletions cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package cmd

import (
"fmt"
"github.com/manifoldco/promptui"
"github.com/mdp/qrterminal/v3"
"github.com/muesli/termenv"
"os"
Expand All @@ -44,22 +43,23 @@ var loginCmd = &cobra.Command{
//to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
// select login methods
prompt := promptui.Select{
Label: "Login Method",
Items: []string{"GitHub", "WeChat"},
}

_, loginMethod, err := prompt.Run()

if err != nil {
if err == promptui.ErrInterrupt {
os.Exit(-1)
return
}

loginMethod = "GitHub"
}

// TODO: support more login methods
//prompt := promptui.Select{
// Label: "Login Method",
// Items: []string{"GitHub", "WeChat"},
//}
//
//_, loginMethod, err := prompt.Run()
//
//if err != nil {
// if err == promptui.ErrInterrupt {
// os.Exit(-1)
// return
// }
//
// loginMethod = "GitHub"
//}
loginMethod := "GitHub"
log.BStart("loading...")

// get ticket id
Expand Down
5 changes: 5 additions & 0 deletions handler/deploy/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func (c *DeployContext) DetectProjectType() (projectType string) {
}
maps.Copy(packageConfig.Dependencies, packageConfig.DevDependencies)
for k := range packageConfig.Dependencies {
if strings.Contains(k, "express") {
c.Type = "express"
return "express"
}

if strings.Contains(k, "@docusaurus") {
c.Type = "docusaurus"
return "docusaurus"
Expand Down

0 comments on commit fe5c670

Please sign in to comment.