Skip to content

Commit

Permalink
Move copyItem into it's own file
Browse files Browse the repository at this point in the history
  • Loading branch information
osyrisrblx committed Sep 25, 2020
1 parent 492be62 commit 9e1e988
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/Project/functions/copyFiles.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import fs from "fs-extra";
import { copyItem } from "Project/functions/copyItem";
import { ProjectServices } from "Project/types";
import { isCompilableFile } from "Project/util/isCompilableFile";
import { benchmarkIfVerbose } from "Shared/util/benchmark";

export function copyItem(services: ProjectServices, item: string) {
fs.copySync(item, services.pathTranslator.getOutputPath(item), {
filter: src => !isCompilableFile(src),
dereference: true,
});
}

export function copyFiles(services: ProjectServices, sources: Set<string>) {
benchmarkIfVerbose("copy non-compiled files", () => {
for (const source of sources) {
Expand Down
10 changes: 10 additions & 0 deletions src/Project/functions/copyItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import fs from "fs-extra";
import { ProjectServices } from "Project";
import { isCompilableFile } from "Project/util/isCompilableFile";

export function copyItem(services: ProjectServices, item: string) {
fs.copySync(item, services.pathTranslator.getOutputPath(item), {
filter: src => !isCompilableFile(src),
dereference: true,
});
}
3 changes: 2 additions & 1 deletion src/Project/functions/setupProjectWatchProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import fs from "fs-extra";
import { createProjectServices, ProjectData } from "Project";
import { cleanup } from "Project/functions/cleanup";
import { compileFiles } from "Project/functions/compileFiles";
import { copyFiles, copyItem } from "Project/functions/copyFiles";
import { copyFiles } from "Project/functions/copyFiles";
import { copyInclude } from "Project/functions/copyInclude";
import { copyItem } from "Project/functions/copyItem";
import { createProgramFactory } from "Project/functions/createProgramFactory";
import { getChangedSourceFiles } from "Project/functions/getChangedSourceFiles";
import { getParsedCommandLine } from "Project/functions/getParsedCommandLine";
Expand Down

0 comments on commit 9e1e988

Please sign in to comment.