Skip to content

Commit

Permalink
Fixed pnpm bug that is present in installation (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
hartejsingh12 authored Dec 28, 2023
1 parent 160b391 commit bcc7df2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Run `dlp-cli` in DLP's project directory in the terminal

Step 1: If you don't have the `dlp-cli` submodule, run `git submodule init dlp-cli` in the project directory. Then run `git submodule update`. If it says that you are in a detached HEAD state, cd to the dlp-cli submodule directory and `git checkout main`.

Step 2: Run cli in debug mode with `go run main.go`
Step 2: Run cli in debug mode with `go run main.go`. For example, if you wanted to run the frontend install command in debug mode, run `go run main.go frontend install`.

Step 3: Make sure to add package paths of all files as imports in main.go

Expand Down
1 change: 0 additions & 1 deletion cmd/frontend/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var FrontendCmd = &cobra.Command{

func init() {
cmd.RootCmd.AddCommand(FrontendCmd)
FrontendCmd.PersistentFlags().Bool("yarn", false, "Uses yarn instead of pnpm")
}

func ExecBashCmd(name string, args ...string) string {
Expand Down
7 changes: 2 additions & 5 deletions cmd/frontend/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ var InstallCmd = &cobra.Command{
if cmd.Flag("force").Value.String() == "true" {
bash_args = append(bash_args, "--force")
}
if cmd.Flag("yarn").Value.String() == "true" {
frontend.ExecBashCmd("yarn", bash_args...)
} else {
frontend.ExecBashCmd("pnpm", bash_args...)
}
frontend.ExecBashCmd("npm" , "install" , "-g" , "pnpm")
frontend.ExecBashCmd("pnpm", bash_args...)
},
}

Expand Down
7 changes: 1 addition & 6 deletions cmd/frontend/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ var StartCmd = &cobra.Command{
Long: `Starts an instance of the nextjs frontend in the terminal`,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
if cmd.Flag("yarn").Value.String() == "true" {
frontend.ExecBashCmd("yarn", "start", "-p", fmt.Sprintf("%v", cmd.Flag("port").Value))
} else {
frontend.ExecBashCmd("pnpm", "start", "-p", fmt.Sprintf("%v", cmd.Flag("port").Value))
}

frontend.ExecBashCmd("pnpm", "start", "-p", fmt.Sprintf("%v", cmd.Flag("port").Value))
},
}

Expand Down

0 comments on commit bcc7df2

Please sign in to comment.