-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When we create a project using one of the templates that templates manifest should be automatically applied upon creation.
There are two reasons this doesn't happen right now:
- [BUG] Can't run a single component without running everything #482, which means that we would start all of the components, which isn't what we want.
- I'm not clear on how to best get a handle on a workspace from within a kernel function. Specifically, I'm not sure how to get a reference to a relevant
Workspace
struct from within here:exo/internal/core/server/kernel.go
Lines 80 to 117 in 535bb90
func (kern *Kernel) CreateProject(ctx context.Context, input *api.CreateProjectInput) (*api.CreateProjectOutput, error) { projectDir := input.Root if !filepath.IsAbs(projectDir) { return nil, errors.New("path must be absolute") } var templateDir string if input.TemplateURL != nil { var err error templateDir, err = template.GetTemplateFiles(ctx, *input.TemplateURL) if err != nil { return nil, fmt.Errorf("getting template files: %w", err) } } if templateDir != "" { err := os.Rename(templateDir, projectDir) if err != nil { if os.IsExist(err) { return nil, dirExistsErr } return nil, fmt.Errorf("moving project dir: %w", err) } } else { if err := os.Mkdir(projectDir, 0750); err != nil { if os.IsExist(err) { return nil, dirExistsErr } return nil, fmt.Errorf("making project dir: %w", err) } } result, err := kern.CreateWorkspace(ctx, &api.CreateWorkspaceInput{Root: projectDir}) if err != nil { return nil, fmt.Errorf("creating workspace: %w", err) } return &api.CreateProjectOutput{WorkspaceID: result.ID}, err }
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working