Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
fix: compile skip check (#73)
Browse files Browse the repository at this point in the history
* fix: compile skip check

* fix: get yml file path
  • Loading branch information
echosoar committed Mar 6, 2020
1 parent 6596bae commit c61e2ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/serverless-invoke/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { FaaSStarterClass, cleanTarget, compareFileChange } from './utils';
import { join, resolve, relative } from 'path';
import { existsSync, move, writeFileSync, ensureFileSync } from 'fs-extra';
import { loadSpec } from '@midwayjs/fcli-command-core';
import { loadSpec, getSpecFile } from '@midwayjs/fcli-command-core';
import { writeWrapper } from '@midwayjs/serverless-spec-builder';
import { AnalyzeResult, Locator } from '@midwayjs/locate';
import {
Expand Down Expand Up @@ -37,6 +37,7 @@ export abstract class InvokeCore implements IInvoke {
spec: any;
buildDir: string;
wrapperInfo: any;
specFile: string;
codeAnalyzeResult: AnalyzeResult;

constructor(options: InvokeOptions) {
Expand All @@ -45,6 +46,7 @@ export abstract class InvokeCore implements IInvoke {
this.baseDir = this.options.baseDir;
this.buildDir = resolve(this.baseDir, options.buildDir || 'dist');
this.spec = loadSpec(this.baseDir);
this.specFile = getSpecFile(this.baseDir).path;
}

protected async getStarter() {
Expand Down Expand Up @@ -99,7 +101,7 @@ export abstract class InvokeCore implements IInvoke {
const buildLogPath = resolve(this.buildDir, '.faasTSBuildTime.log');
if (existsSync(buildLogPath)) {
const fileChanges = await compareFileChange(
[ `${relative(baseDir, this.codeAnalyzeResult.tsCodeRoot)}/**/*` ],
[ this.specFile, `${relative(baseDir, this.codeAnalyzeResult.tsCodeRoot)}/**/*` ],
[ buildLogPath ],
{ cwd: baseDir }
);
Expand Down

0 comments on commit c61e2ad

Please sign in to comment.