-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(CTA): #1569, manually set tauri script for compatability with old…
…er npm (#1572)
- Loading branch information
Showing
4 changed files
with
45 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-tauri-app": patch | ||
--- | ||
|
||
Manually set `tauri` script instead of using `npm set-script` for compatabilty with older npm versions |
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
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,26 @@ | ||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { readFileSync, writeFileSync } from "fs"; | ||
import { join } from "path"; | ||
|
||
export async function addTauriScript(appDirectory: string) { | ||
const pkgPath = join(appDirectory, "package.json"); | ||
const pkgString = readFileSync(pkgPath, "utf8"); | ||
const pkg = JSON.parse(pkgString) as { | ||
scripts: { | ||
tauri: string; | ||
}; | ||
}; | ||
|
||
let outputPkg = { | ||
...pkg, | ||
scripts: { | ||
...pkg.scripts, | ||
tauri: "tauri", | ||
}, | ||
}; | ||
|
||
writeFileSync(pkgPath, JSON.stringify(outputPkg, undefined, 2)); | ||
} |
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