@@ -39,7 +39,6 @@ func init() {
3939}
4040
4141func runSandboxStart (cmd * cobra.Command , args []string ) error {
42- // Get current working directory
4342 cwd , err := os .Getwd ()
4443 if err != nil {
4544 return fmt .Errorf ("failed to get current directory: %w" , err )
@@ -48,23 +47,19 @@ func runSandboxStart(cmd *cobra.Command, args []string) error {
4847 fmt .Println ("📦 Scanning for existing sandbox projects..." )
4948 fmt .Println ()
5049
51- // Scan for existing projects
5250 existingProjects , err := sandbox .ScanSandboxProjects (cwd )
5351 if err != nil {
5452 return fmt .Errorf ("failed to scan sandbox projects: %w" , err )
5553 }
5654
57- // Get available create options
5855 createOptions , err := sandbox .GetAvailableCreateOptions (cwd )
5956 if err != nil {
6057 return fmt .Errorf ("failed to get available create options: %w" , err )
6158 }
6259
63- // Build options list for user selection
6460 var options []string
6561 var optionMap = make (map [string ]sandboxOption )
6662
67- // Add existing projects
6863 for _ , p := range existingProjects {
6964 label := fmt .Sprintf ("%s (Local) - %s" , p .Name , p .Path )
7065 options = append (options , label )
@@ -74,9 +69,7 @@ func runSandboxStart(cmd *cobra.Command, args []string) error {
7469 }
7570 }
7671
77- // Add create options
7872 for _ , p := range createOptions {
79- // Capitalize first letter
8073 name := p .Name
8174 if len (name ) > 0 {
8275 name = strings .ToUpper (string (name [0 ])) + name [1 :]
@@ -93,7 +86,6 @@ func runSandboxStart(cmd *cobra.Command, args []string) error {
9386 return fmt .Errorf ("no sandbox options available" )
9487 }
9588
96- // Prompt user to select
9789 var selected string
9890 prompt := & survey.Select {
9991 Message : "Select a sandbox project:" ,
@@ -110,7 +102,6 @@ func runSandboxStart(cmd *cobra.Command, args []string) error {
110102 return fmt .Errorf ("selected option not found" )
111103 }
112104
113- // Handle the selection
114105 if option .isCreate {
115106 return handleCreate (option .project , cwd )
116107 } else {
@@ -124,7 +115,6 @@ type sandboxOption struct {
124115}
125116
126117func handleCreate (project sandbox.SandboxProject , baseDir string ) error {
127- // Check if project already exists and prompt for overwrite
128118 if project .Exists {
129119 var overwrite bool
130120 prompt := & survey.Confirm {
@@ -143,7 +133,6 @@ func handleCreate(project sandbox.SandboxProject, baseDir string) error {
143133 }
144134 }
145135
146- // Prompt for package manager
147136 fmt .Println ()
148137 fmt .Println ("📦 Select package manager:" )
149138 pmOptions := []string {"pnpm" , "npm" , "yarn" , "bun" }
@@ -158,12 +147,6 @@ func handleCreate(project sandbox.SandboxProject, baseDir string) error {
158147 return fmt .Errorf ("failed to get package manager selection: %w" , err )
159148 }
160149
161- // Check if package manager is installed
162- if ! isPackageManagerInstalled (selectedPM ) {
163- return fmt .Errorf ("package manager '%s' is not installed. Please install it first" , selectedPM )
164- }
165-
166- // Create the project
167150 if project .Exists {
168151 if err := sandbox .CreateSandboxProjectWithOverwrite (project .Name , selectedPM , baseDir ); err != nil {
169152 return fmt .Errorf ("failed to create project: %w" , err )
@@ -176,29 +159,19 @@ func handleCreate(project sandbox.SandboxProject, baseDir string) error {
176159
177160 fmt .Println ()
178161
179- // Get the project directory
180162 projectDir , err := sandbox .GetProjectDir (baseDir , project .Path )
181163 if err != nil {
182164 return fmt .Errorf ("failed to get project directory: %w" , err )
183165 }
184166
185- // Start the project
186167 return sandbox .StartProject (projectDir )
187168}
188169
189170func handleStart (project sandbox.SandboxProject , baseDir string ) error {
190- // Get the project directory
191171 projectDir , err := sandbox .GetProjectDir (baseDir , project .Path )
192172 if err != nil {
193173 return fmt .Errorf ("failed to get project directory: %w" , err )
194174 }
195175
196- // Start the project
197176 return sandbox .StartProject (projectDir )
198177}
199-
200- func isPackageManagerInstalled (pm string ) bool {
201- // This is a simple check - we'll let the actual command execution handle errors
202- // For now, just return true and let the create command fail if not installed
203- return true
204- }
0 commit comments