-
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
Showing
4 changed files
with
15 additions
and
21 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 |
---|---|---|
|
@@ -3,8 +3,10 @@ import { ensureDirSync } from "https://deno.land/[email protected]/fs/ensure_dir.ts"; | |
import { existsSync } from "https://deno.land/[email protected]/fs/exists.ts"; | ||
|
||
const parsedArgs = parseArgs(Deno.args); | ||
if(!parsedArgs["_"][0]) { | ||
console.error("\u001b[31m[ERROR]:Please input resource name. ex cli.ts user\u001b[0m"); | ||
if (!parsedArgs["_"][0]) { | ||
console.error( | ||
"\u001b[31m[ERROR]:Please input resource name. ex cli.ts user\u001b[0m", | ||
); | ||
Deno.exit(1); | ||
} | ||
|
||
|
@@ -13,7 +15,7 @@ ensureDirSync(`./plantation/${parsedArgs["_"][0]}`); | |
|
||
// ./plantation/extra_load.tsx が存在しなければ作成する | ||
if (!existsSync(`./plantation/extra_load.tsx`)) { | ||
const souceText = "console.log('Load ./plantation!');\n" | ||
const souceText = "console.log('Load ./plantation!');\n"; | ||
|
||
Deno.writeTextFileSync( | ||
`./plantation/extra_load.ts`, | ||
|
@@ -22,7 +24,6 @@ if (!existsSync(`./plantation/extra_load.tsx`)) { | |
console.info(`✅ Create File: ./plantation/extra_load.ts`); | ||
} | ||
|
||
|
||
const create = await fetch( | ||
"https://deno.land/x/[email protected]/routesTemplate/create.tsx?source=", | ||
); | ||
|
@@ -35,7 +36,7 @@ console.info(`✅ Create File: ${createFilePath}`); | |
Deno.writeTextFileSync( | ||
`./plantation/extra_load.ts`, | ||
`(async () => await import('.${createFilePath}'));\n`, | ||
{append: true} | ||
{ append: true }, | ||
); | ||
|
||
const login = await fetch( | ||
|
@@ -51,7 +52,7 @@ console.info(`✅ Create File: ${loginFilePath}`); | |
Deno.writeTextFileSync( | ||
`./plantation/extra_load.ts`, | ||
`(async () => await import('.${loginFilePath}'));\n`, | ||
{append: true} | ||
{ append: true }, | ||
); | ||
const logout = await fetch( | ||
"https://raw.githubusercontent.com/Octo8080X/plantation/main/routesTemplate/logout.tsx", | ||
|
@@ -66,7 +67,9 @@ console.info(`✅ Create File: ${logoutFilePath}`); | |
Deno.writeTextFileSync( | ||
`./plantation/extra_load.ts`, | ||
`(async () => await import('.${logoutFilePath}'));\n`, | ||
{append: true} | ||
{ append: true }, | ||
); | ||
|
||
console.info(`Please add \`(async () => await import('./plantation/extra_loader.ts'));\` to your main.ts.`); | ||
console.info( | ||
`Please add \`(async () => await import('./plantation/extra_loader.ts'));\` to your main.ts.`, | ||
); |
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 |
---|---|---|
|
@@ -22,6 +22,4 @@ export { | |
type WithCsrf, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
export { h, type JSX } from "https://esm.sh/[email protected]"; | ||
export { | ||
setCookie, | ||
} from "https://deno.land/[email protected]/http/cookie.ts"; | ||
export { setCookie } from "https://deno.land/[email protected]/http/cookie.ts"; |
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