@@ -12,10 +12,10 @@ import {
1212 VanillaTemplate ,
1313} from "./utils/constants" ;
1414import { detectPackageManager } from "@solid-cli/utils/package-manager" ;
15- import { insertAtEnd } from "@solid-cli/utils/fs" ;
1615import { existsSync , writeFileSync } from "node:fs" ;
1716import { join } from "node:path" ;
1817import { createLibrary } from "./create-library" ;
18+ import { readFile , writeFile } from "node:fs/promises" ;
1919export { createVanilla , createStart } ;
2020
2121export const createSolid = ( version : string ) =>
@@ -133,11 +133,12 @@ export const createSolid = (version: string) =>
133133 // Add .gitignore
134134 writeFileSync ( join ( projectName , ".gitignore" ) , GIT_IGNORE ) ;
135135 // Add "Created with Solid CLI" text to bottom of README
136- if ( existsSync ( `${ projectName } /README.md` ) )
137- await insertAtEnd (
138- `${ projectName } /README.md` ,
139- "\n## This project was created with the [Solid CLI](https://github.com/solidjs-community/solid-cli)\n" ,
140- ) ;
136+ const readmePath = `${ projectName } /README.md` ;
137+ if ( existsSync ( readmePath ) ) {
138+ const contents = ( await readFile ( readmePath ) ) . toString ( ) ;
139+ if ( ! contents . includes ( "This project was created with the [Solid CLI]" ) )
140+ await writeFile ( readmePath , contents + "\n## This project was created with the [Solid CLI](https://github.com/solidjs-community/solid-cli)\n" )
141+ }
141142 // Next steps..
142143 const pM = detectPackageManager ( ) ;
143144 p . note (
0 commit comments