Skip to content

Commit

Permalink
fix windows cross volume init (#3512)
Browse files Browse the repository at this point in the history
changelog
  • Loading branch information
atterpac authored May 25, 2024
1 parent 1d2e1b1 commit 940d0f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions mkdocs-website/docs/en/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed cross volume project install for windows by [atterpac](https://github.com/atterac) in [#3512](https://github.com/wailsapp/wails/pull/3512)
- Fixed react template css to show footer by [atterpac](https://github.com/atterpac) in [#3477](https://github.com/wailsapp/wails/pull/3477)
- Fixed zombie processes when working in devmode by updating to latest refresh by [Atterpac](https://github.com/atterpac) in [#3320](https://github.com/wailsapp/wails/pull/3320).
- Fixed appimage webkit file sourcing by [Atterpac](https://github.com/atterpac) in [#3306](https://github.com/wailsapp/wails/pull/3306).
Expand Down
15 changes: 11 additions & 4 deletions v3/internal/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,27 @@ func getRemoteTemplate(uri string) (template *Template, err error) {
}

func Install(options *flags.Init) error {

var wd string = lo.Must(os.Getwd())
var projectDir string
if options.ProjectDir == "." || options.ProjectDir == "" {
projectDir = lo.Must(os.Getwd())
projectDir = wd
} else {
projectDir = options.ProjectDir
}
var err error
projectDir, err = filepath.Abs(filepath.Join(options.ProjectDir, options.ProjectName))
projectDir, err = filepath.Abs(filepath.Join(projectDir, options.ProjectName))
if err != nil {
return err
}

// Calculate relative path from project directory to LocalModulePath
var relativePath string
relativePath, err = filepath.Rel(projectDir, debug.LocalModulePath)
// Check if the project directory and LocalModulePath are in the same drive
if filepath.VolumeName(wd) != filepath.VolumeName(debug.LocalModulePath) {
relativePath = debug.LocalModulePath
} else {
relativePath, err = filepath.Rel(projectDir, debug.LocalModulePath)
}
if err != nil {
return err
}
Expand Down

0 comments on commit 940d0f1

Please sign in to comment.