Skip to content

Commit d462775

Browse files
authored
fix: use @latest tag (#58)
1 parent c766016 commit d462775

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

.changes/use-latest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-tauri-app": "patch"
3+
---
4+
5+
Use `@latest` tag when creating the recipe so `npm` wouldn't load from cache.

src/package-manager.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class Npm implements PackageManager {
103103
if (this.version >= 7) {
104104
await shell(
105105
'npm',
106-
['init', createApp, this.ci ? '--yes' : '', '--', ...args],
106+
['init', `${createApp}@latest`, this.ci ? '--yes' : '', '--', ...args],
107107
{
108108
cwd: options?.cwd
109109
},
@@ -112,7 +112,7 @@ export class Npm implements PackageManager {
112112
} else {
113113
await shell(
114114
'npm',
115-
['init', this.ci ? '--yes' : '', createApp, ...args],
115+
['init', this.ci ? '--yes' : '', `${createApp}@latest`, ...args],
116116
{ cwd: options?.cwd },
117117
this.log
118118
)
@@ -163,7 +163,12 @@ export class Yarn implements PackageManager {
163163
): Promise<void> {
164164
await shell(
165165
'yarn',
166-
['create', this.ci ? '--non-interactive' : '', createApp, ...args],
166+
[
167+
'create',
168+
this.ci ? '--non-interactive' : '',
169+
`${createApp}@latest`,
170+
...args
171+
],
167172
{
168173
cwd: options?.cwd
169174
},
@@ -224,7 +229,7 @@ export class Pnpm implements PackageManager {
224229
): Promise<void> {
225230
await shell(
226231
'pnpm',
227-
['create', createApp, '--', ...args],
232+
['create', `${createApp}@latest`, '--', ...args],
228233
{
229234
cwd: options?.cwd
230235
},

0 commit comments

Comments
 (0)