File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ export type ServerlessResourceConfig = {
35
35
path ?: string ;
36
36
} ;
37
37
38
+ export type ServerlessResourceConfigWithFilePath = ServerlessResourceConfig & {
39
+ /**
40
+ * Path to the actual file on the file system.
41
+ */
42
+ filePath : string ;
43
+ } ;
44
+
38
45
export type FunctionResource = ServerlessResourceConfig & {
39
46
sid : string ;
40
47
} ;
@@ -61,6 +68,6 @@ export type ResourcePathAndAccess = {
61
68
} ;
62
69
63
70
export type DirectoryContent = {
64
- assets : ServerlessResourceConfig [ ] ;
65
- functions : ServerlessResourceConfig [ ] ;
71
+ assets : ServerlessResourceConfigWithFilePath [ ] ;
72
+ functions : ServerlessResourceConfigWithFilePath [ ] ;
66
73
} ;
Original file line number Diff line number Diff line change 9
9
AccessOptions ,
10
10
DirectoryContent ,
11
11
FileInfo ,
12
- ServerlessResourceConfig ,
13
12
ResourcePathAndAccess ,
13
+ ServerlessResourceConfig ,
14
+ ServerlessResourceConfigWithFilePath ,
14
15
} from '../types' ;
15
16
16
17
const log = debug ( 'twilio-serverless-api:fs' ) ;
@@ -226,7 +227,7 @@ export async function getListOfFunctionsAndAssets(
226
227
async function getServerlessConfigs (
227
228
dirContent : FileInfo [ ] ,
228
229
ignoreExtension ?: string
229
- ) : Promise < ServerlessResourceConfig [ ] > {
230
+ ) : Promise < ServerlessResourceConfigWithFilePath [ ] > {
230
231
return Promise . all (
231
232
dirContent . map ( async file => {
232
233
const { path, access } = getPathAndAccessFromFileInfo (
@@ -241,6 +242,7 @@ async function getServerlessConfigs(
241
242
path,
242
243
access,
243
244
content,
245
+ filePath : file . path ,
244
246
} ;
245
247
} )
246
248
) ;
You can’t perform that action at this time.
0 commit comments