Skip to content

Commit

Permalink
fix: issue with init workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslin committed Sep 9, 2021
1 parent 4e478e4 commit 94d05c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
17 changes: 1 addition & 16 deletions packages/plugin-core/src/commands/Doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import {
DoctorActions,
DoctorCLICommand,
} from "@dendronhq/dendron-cli";
import fs from "fs-extra";
import _ from "lodash";
import _md from "markdown-it";
import path from "path";
import { QuickPick, ViewColumn, window } from "vscode";
import {
ChangeScopeBtn,
Expand All @@ -22,7 +20,7 @@ import { DoctorScopeType } from "../components/doctor/types";
import { DENDRON_COMMANDS } from "../constants";
import { delayedUpdateDecorations } from "../features/windowDecorations";
import { VSCodeUtils } from "../utils";
import { getExtension, getDWorkspace } from "../workspace";
import { getDWorkspace, getExtension } from "../workspace";
import { BasicCommand } from "./base";
import { ReloadIndexCommand } from "./ReloadIndex";

Expand Down Expand Up @@ -158,7 +156,6 @@ export class DoctorCommand extends BasicCommand<CommandOpts, CommandOutput> {
throw Error("no config found");
}

const siteRoot = path.join(wsRoot, config.site.siteRootDir);
if (ext.fileWatcher) {
ext.fileWatcher.pause = true;
}
Expand Down Expand Up @@ -261,18 +258,6 @@ export class DoctorCommand extends BasicCommand<CommandOpts, CommandOutput> {
// do so after a delay so that VSCode can update the file contents. Not a
// perfect solution, but the simplest.
delayedUpdateDecorations();

// create site root, used for publication
if (!fs.existsSync(siteRoot)) {
const f: Finding = { issue: "no siteRoot found" };
const dendronJekyll = VSCodeUtils.joinPath(
getDWorkspace().assetUri,
"jekyll"
);
fs.copySync(dendronJekyll.fsPath, siteRoot);
f.fix = `created siteRoot at ${siteRoot}`;
findings.push(f);
}
return { data: findings };
}
async showResponse(findings: CommandOutput) {
Expand Down
13 changes: 0 additions & 13 deletions packages/plugin-core/src/workspace/blankInitializer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { DVault } from "@dendronhq/common-all";
import { vault2Path } from "@dendronhq/common-server";
import { Snippets } from "@dendronhq/engine-server";
import fs from "fs-extra";
import path from "path";
import { VSCodeUtils } from "../utils";
import { getDWorkspace } from "../workspace";
import { WorkspaceInitializer } from "./workspaceInitializer";

/**
Expand All @@ -22,16 +19,6 @@ export class BlankInitializer implements WorkspaceInitializer {
}): Promise<void> {
const vpath = vault2Path({ vault: opts.vaults[0], wsRoot: opts.wsRoot });

// copy over jekyll config
const dendronJekyll = VSCodeUtils.joinPath(
getDWorkspace().assetUri,
"jekyll"
);
fs.copySync(
path.join(dendronJekyll.fsPath),
path.join(opts.wsRoot, "docs")
);

// write snippets
const vscodeDir = path.join(vpath, ".vscode");
Snippets.create(vscodeDir);
Expand Down

0 comments on commit 94d05c8

Please sign in to comment.