Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature/validate#34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 11 commits intomasterfromfeature/validate
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
switch to fs-extra in validate
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
@ShMcK
ShMcK committedJun 13, 2020
commit40a57fb181a7735af3858f041c4d027814f7d987
44 changes: 41 additions & 3 deletionspackage-lock.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 2 additions & 0 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,6 +49,7 @@
"dependencies": {
"ajv": "^6.12.2",
"esm": "^3.2.25",
"fs-extra": "^9.0.1",
"js-yaml": "^3.14.0",
"kleur": "^3.0.3",
"lodash": "^4.17.15",
Expand All@@ -58,6 +59,7 @@
"devDependencies": {
"@babel/preset-typescript": "^7.10.1",
"@types/ajv": "^1.0.0",
"@types/fs-extra": "^9.0.1",
"@types/inquirer": "^6.5.0",
"@types/jest": "^25.2.3",
"@types/js-yaml": "^3.12.4",
Expand Down
22 changes: 9 additions & 13 deletionssrc/validate.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
import * as path from "path";
import * as fs from "fs";
import util from "util";
import * as fs from "fs-extra";
import * as yamlParser from "js-yaml";
import { getArg } from "./utils/args";
import gitP, { SimpleGit } from "simple-git/promise";
import { getCommits, CommitLogObject } from "./utils/commits";
import simplegit from "simple-git/promise";

const mkdir = util.promisify(fs.mkdir);
const exists = util.promisify(fs.exists);
const rmdir = util.promisify(fs.rmdir);
const read = util.promisify(fs.readFile);

async function validate(args: string[]) {
// dir - default .
Expand All@@ -22,7 +15,7 @@ async function validate(args: string[]) {
yaml: getArg(args, { name: "yaml", alias: "y" }) || "coderoad.yaml",
};

const _yaml = awaitread(path.join(localDir, options.yaml), "utf8");
const _yaml = awaitfs.readFile(path.join(localDir, options.yaml), "utf8");

// parse yaml config
let skeleton;
Expand All@@ -42,19 +35,22 @@ async function validate(args: string[]) {
const codeBranch: string = skeleton.config.repo.branch;

// validate commits
const commits = await getCommits({ localDir, codeBranch });
const commits: CommitLogObject = await getCommits({ localDir, codeBranch });
console.log("commits", commits);

// setup tmp dir
const tmpDir = path.join(localDir, ".tmp");

try {
if (!(awaitexists(tmpDir))) {
awaitmkdir(tmpDir);
if (!(awaitfs.pathExists(tmpDir))) {
awaitfs.emptyDir(tmpDir);
}
const tempGit: SimpleGit = gitP(tmpDir);
await tempGit.init();

// VALIDATE TUTORIAL TESTS
if (commits.INIT) {
}

// run test runner setup command(s)
// loop over commits:
Expand All@@ -75,7 +71,7 @@ async function validate(args: string[]) {
console.error(e.message);
} finally {
// cleanup
awaitrmdir(tmpDir);
awaitfs.emptyDir(tmpDir);
}
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp