Skip to content

Commit e3e0a30

Browse files
author
ljacobsson
committed
toml conversion fix
1 parent 7ea9959 commit e3e0a30

3 files changed

Lines changed: 33 additions & 6 deletions

File tree

package-lock.json

Lines changed: 27 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "samp-cli",
3-
"version": "1.0.17",
3+
"version": "1.0.18",
44
"description": "CLI tool for extended productivity with AWS Serverless Application Model (SAM)",
55
"main": "index.js",
66
"scripts": {
@@ -63,7 +63,9 @@
6363
"open": "^7.4.2",
6464
"openai": "^3.3.0",
6565
"rimraf": "^5.0.1",
66+
"toml": "^3.0.0",
6667
"tsc-watch": "^6.0.4",
68+
"yaml": "^2.3.1",
6769
"yaml-cfn": "^0.3.2"
6870
},
6971
"devDependencies": {

src/commands/convert-toml/convertToml.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const ini = require('ini');
1+
const toml = require('toml');
22
const fs = require('fs');
33
const path = require('path');
44
const inputUtil = require("../../shared/inputUtil");
5-
const YAML = require('json-to-pretty-yaml');
5+
const YAML = require('yaml');
66
async function run(cmd) {
77
if (!fs.existsSync(path.join(process.cwd(), 'samconfig.toml'))) {
88
console.log("samconfig.toml not found");
99
return;
1010
}
1111

12-
const samconfig = ini.parse(fs.readFileSync(path.join(process.cwd(), 'samconfig.toml'), 'utf-8'));
12+
const samconfig = toml.parse(fs.readFileSync(path.join(process.cwd(), 'samconfig.toml'), 'utf-8'));
1313
const samconfigYaml = YAML.stringify(samconfig);
1414
fs.writeFileSync(path.join(process.cwd(), 'samconfig.yaml'), samconfigYaml);
1515
deleteToml = await inputUtil.prompt("Conversion complete. Delete samconfig.toml? (Y/n)");

0 commit comments

Comments
 (0)