-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18ece36
commit a80508f
Showing
5 changed files
with
59 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"cSpell.words": ["dotnet", "vite"] | ||
"cSpell.words": ["dotnet", "tauri", "Tauri", "vite"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package tauri | ||
|
||
import ( | ||
"github.com/zwoo-hq/zwooc/pkg/model" | ||
"github.com/zwoo-hq/zwooc/pkg/tasks" | ||
) | ||
|
||
type tauriAdapter struct { | ||
packageManager string | ||
} | ||
|
||
var _ model.Adapter = (*tauriAdapter)(nil) | ||
|
||
func NewYarnAdapter() model.Adapter { | ||
return &tauriAdapter{"yarn"} | ||
} | ||
|
||
func NewNpmAdapter() model.Adapter { | ||
return &tauriAdapter{"npm"} | ||
} | ||
|
||
func NewPnpmAdapter() model.Adapter { | ||
return &tauriAdapter{"pnpm"} | ||
} | ||
|
||
func (a *tauriAdapter) CreateTask(c model.ProfileWrapper, extraArgs []string) tasks.Task { | ||
return createTauriTask(a.packageManager, c, extraArgs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package tauri | ||
|
||
import ( | ||
"github.com/zwoo-hq/zwooc/pkg/adapter/shared" | ||
"github.com/zwoo-hq/zwooc/pkg/model" | ||
"github.com/zwoo-hq/zwooc/pkg/tasks" | ||
) | ||
|
||
func createTauriTask(packageManager string, c model.ProfileWrapper, extraArgs []string) tasks.Task { | ||
cmd, additionalArgs := shared.CreateBaseCommand(packageManager, c, extraArgs) | ||
cmd.Args = append(cmd.Args, "tauri") | ||
cmd.Args = append(cmd.Args, convertModeToTauri(c.GetMode())) | ||
|
||
cmd.Args = append(cmd.Args, additionalArgs...) | ||
return tasks.NewCommandTask(c.GetName(), cmd) | ||
} | ||
|
||
func convertModeToTauri(mode string) string { | ||
switch mode { | ||
case model.ModeBuild: | ||
return "build" | ||
case model.ModeWatch: | ||
return "dev" | ||
case model.ModeRun: | ||
return "dev" | ||
} | ||
return "" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters