Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wails3 init for non-local builds #3256

Draft
wants to merge 1 commit into
base: v3-alpha
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions v3/internal/templates/templates.go
Expand Up @@ -213,17 +213,20 @@ func Install(options *flags.Init) error {
}

// Calculate relative path from project directory to LocalModulePath
var relativePath string
relativePath, err = filepath.Rel(projectDir, debug.LocalModulePath)
if err != nil {
return err
var localModulePath string
if debug.LocalModulePath != "" {
relativePath, err := filepath.Rel(projectDir, debug.LocalModulePath)
if err != nil {
return err
}
localModulePath = filepath.ToSlash(relativePath + "/")
}

UseTypescript := strings.HasSuffix(options.TemplateName, "-ts")

templateData := TemplateOptions{
Init: options,
LocalModulePath: filepath.ToSlash(relativePath + "/"),
LocalModulePath: localModulePath,
UseTypescript: UseTypescript,
}

Expand Down