Skip to content

Commit b52eec7

Browse files
committed
Install favicon
1 parent 99ec8d0 commit b52eec7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import { create } from 'create-svelte' // @latest
44

5+
$.verbose = false
6+
57
export async function patchFiles(filepaths, ...replacers) {
68
for (const file of [filepaths].flat()) {
79
let contents = await fs.readFile(file, 'utf8')
@@ -12,6 +14,11 @@ export async function patchFiles(filepaths, ...replacers) {
1214
}
1315
}
1416

17+
export async function getVersion(pkg) {
18+
const version = await $`npm show ${pkg} version`
19+
return version.toString()
20+
}
21+
1522
export async function addBaseTemplate({ name, template }) {
1623
await fs.remove(name)
1724
await create(name, {
@@ -23,10 +30,13 @@ export async function addBaseTemplate({ name, template }) {
2330
playwright: true,
2431
vitest: false
2532
})
33+
await fetch('https://raw.githubusercontent.com/zerodevx/sveltekit-starter/main/favicon.png').then(
34+
(r) => r.body.pipe(fs.createWriteStream(path.join(name, 'static', 'favicon.png')))
35+
)
2636
}
2737

2838
export async function addTailwindcss({ name }) {
29-
await $`cd ${name} && npx svelte-add@latest tailwindcss`.quiet()
39+
await $`cd ${name} && npx -y svelte-add@latest tailwindcss`
3040
}
3141

3242
export async function addPrettier({ name }) {
@@ -87,5 +97,8 @@ void (async function () {
8797
echo`- added adapter-static`
8898

8999
echo`\nAll done! Complete the setup with:\n`
90-
echo`$ cd ${opts.name} && npm i && npm run format`
100+
echo`$ cd ${opts.name}`
101+
echo`$ npx npm-check-updates -u`
102+
echo`$ npm i`
103+
echo`$ npm run format`
91104
})()

0 commit comments

Comments
 (0)