Skip to content

Commit

Permalink
generate playground from buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
hemedani committed Jun 9, 2021
1 parent 1309549 commit ea6838a
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 19 deletions.
21 changes: 2 additions & 19 deletions funql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "./config/mod.ts";
import { upgrade } from "./cli/mod.ts";
import { generateDeclarations } from "./declarations/mod.ts";
import { runHelp } from "./help.ts";
import { generatePlay } from "./play/generatePlay.ts";
import { Application } from "https://deno.land/x/[email protected]/mod.ts";

export interface CommandArgs {
Expand All @@ -27,29 +28,11 @@ const createProject = async (init: string | boolean) => {
const runPlayground = async () => {
const app = new Application();

const __dirname = new URL(".", import.meta.url).pathname;
const buildFolder = `${__dirname}playground/build`;
const realPath = await Deno.realPath(buildFolder);

/**
* Please remove log after debug
* @author syd
* Please remove log after debug
*/
console.group();
console.log();
console.log("__dirname, buildFolder, realPath ================== __dirname,");
console.log("==================");
console.log(__dirname, buildFolder, realPath);
console.log("END ------------------ END");
console.log();
console.groupEnd();

const play = await exists("./.play");

play && (await Deno.remove("./.play", { recursive: true }));

await copy(realPath, "./.play");
await generatePlay();

console.log(" Playgroud start at http://localhost:1366/ ");
app
Expand Down
Loading

0 comments on commit ea6838a

Please sign in to comment.