Skip to content

Commit f9665ce

Browse files
authored
test(lambda): sam/config.ts
1 parent 46a12cb commit f9665ce

File tree

3 files changed

+484
-7
lines changed

3 files changed

+484
-7
lines changed

packages/core/src/shared/sam/config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ export class SamConfig {
119119

120120
return Object.entries(envs).map(([name, data]) => ({ name, ...data }))
121121
}
122-
123-
public static async fromUri(uri: vscode.Uri) {
124-
const contents = await fs.readFileText(uri)
125-
const config = await parseConfig(contents)
126-
127-
return new this(uri, config)
128-
}
129122
}
130123

131124
function generateConfigFileName(projectRoot: vscode.Uri) {
@@ -179,6 +172,13 @@ export async function writeSamconfigGlobal(projectRoot: vscode.Uri, stackName: s
179172
await fs.writeFile(path, obj)
180173
}
181174

175+
/**
176+
* @description Create a new samconfig.toml file under the provided project folder.
177+
* This will overwrite the existing file.
178+
179+
* @param projectRoot The root folder of the application project
180+
* @param data The data to be written to the new samconfig.toml file
181+
*/
182182
export async function createNewConfigFile(projectRoot: vscode.Uri, data: JsonMap) {
183183
const path = generateConfigFileName(projectRoot)
184184
await fs.writeFile(path, 'version = 0.1\n\n')

0 commit comments

Comments
 (0)