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

Commit

Permalink
fix: fix invoke lock (#91)
Browse files Browse the repository at this point in the history
* fix: fix invoke lock

* fix: change dynamic require
  • Loading branch information
echosoar committed Mar 18, 2020
1 parent 22f8d99 commit 2a7b847
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/faas-cli-plugin-test/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { BasePlugin } from '@midwayjs/fcli-command-core';
import { TestCommand, CovCommand } from 'midway-bin';
import * as co from 'co';
import { existsSync } from 'fs';
import { join } from 'path';

Expand Down Expand Up @@ -41,6 +39,9 @@ export class TestPlugin extends BasePlugin {
this.core.cli.log('Testing all *.test.js/ts...');
}
const options = this.options;
const TestCommand = require('midway-bin/lib/cmd/test');
const CovCommand = require('midway-bin/lib/cmd/cov');
const co = require('co');
const Command = options.cov ? CovCommand : TestCommand;
const tester = new Command();
await co(function*() {
Expand Down
2 changes: 1 addition & 1 deletion packages/faas-util-ts-compile/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { join, relative, resolve } from 'path';
import { readFileSync, existsSync } from 'fs-extra';
import { BuildCommand } from 'midway-bin';
export * from './utils';
import { combineTsConfig } from './utils';

Expand Down Expand Up @@ -61,6 +60,7 @@ export const tsCompile = async (
incremental?: boolean;
} = {}
) => {
const BuildCommand = require('midway-bin/lib/cmd/build');
const builder = new BuildCommand();
let tsJson = null;
if (options.tsConfigName) {
Expand Down
1 change: 1 addition & 0 deletions packages/serverless-invoke/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export abstract class InvokeCore implements IInvoke {
{ cwd: baseDir }
);
if (!fileChanges || !fileChanges.length) {
lockMap[buildLogPath] = true;
this.debug('Auto skip ts compile');
return;
}
Expand Down

0 comments on commit 2a7b847

Please sign in to comment.