Skip to content

Commit

Permalink
Merge pull request #131 from devonwesley/fix/gitignore_scaffold_bug
Browse files Browse the repository at this point in the history
fixed the .gitignore scaffold bug.
  • Loading branch information
shanejonas authored Apr 7, 2019
2 parents 123784d + 71a86cf commit 0a7b886
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 40 deletions.
45 changes: 13 additions & 32 deletions package-lock.json

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

19 changes: 11 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@ const compileTemplate = async (name: string, schema: types.OpenRPC, language: st
});
};

const moveFiles = async (dirName: string, file1: string, file2: string) => {
try {
await move(path.join(dirName, file1), path.join(dirName, file2));
} catch (error) {
// do nothing
}
}

const copyStatic = async (destinationDirectoryName: string, language: string) => {
await cleanBuildDir(destinationDirectoryName);

const staticPath = path.join(__dirname, "../", `/templates/${language}/static`);
await copy(staticPath, destinationDirectoryName);
try {
await move(
path.join(destinationDirectoryName, "_package.json"),
path.join(destinationDirectoryName, "package.json"),
);
} catch (e) {
// do nothing
}

moveFiles(destinationDirectoryName, "_package.json", "package.json");
moveFiles(destinationDirectoryName, "gitignore", ".gitignore");
};

const typescript = async ({ clientName, schema }: any) => {
Expand Down
File renamed without changes.

0 comments on commit 0a7b886

Please sign in to comment.