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

Commit

Permalink
fix: invoke missing cwd (#116)
Browse files Browse the repository at this point in the history
* fix: invoke

* fix: process.cwd
  • Loading branch information
echosoar committed Apr 7, 2020
1 parent ad01adb commit 424e08b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/faas-cli-plugin-invoke/src/invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface InvokeOptions {

export async function invoke (options: InvokeOptions) {
const baseDir = options.functionDir;
const specFile = getSpecFile(baseDir);
const specFile = getSpecFile(baseDir || process.cwd());
const core = new CommandHookCore({
config: {
servicePath: baseDir,
Expand Down
7 changes: 7 additions & 0 deletions packages/faas-cli-plugin-package/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ export class PackagePlugin extends BasePlugin {
} else {
await compileInProject(this.servicePath, join(this.midwayBuildPath, 'dist'), undefined, { compilerOptions: { sourceRoot: '../src' } });
}
const tmpOutDir = resolve(this.midwayBuildPath, 'faas_tmp_out/src');
if (existsSync(tmpOutDir)) {
await compileWithOptions(this.servicePath, join(this.midwayBuildPath, 'dist'), {
compilerOptions: { rootDir: tmpOutDir },
include: [tmpOutDir]
});
}
this.core.cli.log(` - Build Midway FaaS complete`);
}

Expand Down

0 comments on commit 424e08b

Please sign in to comment.