This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from slackapi/bradh-absolutepaths
handle absolute paths for source and output
- Loading branch information
Showing
2 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import * as path from "https://deno.land/[email protected]/path/mod.ts"; | ||
import { ensureDir } from "https://deno.land/[email protected]/fs/mod.ts" | ||
import { Options } from './types.ts'; | ||
|
||
// deno-lint-ignore no-explicit-any | ||
export const createFunctions = async (options: Options, manifest: any) => { | ||
// Find all the run on slack functions | ||
if (!options.outputDirectory) { | ||
throw new Error('Cannot build function files if no output option is provided'); | ||
} | ||
|
||
// Ensure functions directory exists | ||
const functionsPath = path.join(options.outputDirectory, 'functions'); | ||
await ensureDir(functionsPath); | ||
|
||
// Find all the run on slack functions | ||
for (const fnId in manifest.functions) { | ||
const fnDef = manifest.functions[fnId]; | ||
|
||
|
@@ -37,10 +45,6 @@ export const createFunctions = async (options: Options, manifest: any) => { | |
check: false, | ||
}); | ||
|
||
if (!options.outputDirectory) { | ||
throw new Error('Cannot build function files if no output option is provided'); | ||
} | ||
|
||
// Write FN File and sourcemap file | ||
const fnFileRelative = path.join('functions', `${fnId}.js`); | ||
const fnBundledPath = path.join(options.outputDirectory, fnFileRelative); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters