@sapphire-sh/utils 2.12.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -82,6 +82,9 @@ const writeSectioned = (outputName, content) => {
|
|
|
82
82
|
console.log(`wrote ${outputName}`);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
const formatYamlValue = (value) =>
|
|
86
|
+
typeof value === 'string' && value.includes("'") === false ? `'${value}'` : JSON.stringify(value);
|
|
87
|
+
|
|
85
88
|
const writeWorkflow = (outputName, template) => {
|
|
86
89
|
const filepath = join(cwd, outputName);
|
|
87
90
|
const values = workflowValues[basename(outputName, '.yml')];
|
|
@@ -95,7 +98,7 @@ const writeWorkflow = (outputName, template) => {
|
|
|
95
98
|
const { 'paths-ignore': pathsIgnore, ...withValues } = values;
|
|
96
99
|
|
|
97
100
|
if (pathsIgnore !== undefined) {
|
|
98
|
-
const pathsIgnoreLines = pathsIgnore.map((value) => ` - ${
|
|
101
|
+
const pathsIgnoreLines = pathsIgnore.map((value) => ` - ${formatYamlValue(value)}\n`).join('');
|
|
99
102
|
content = content.replace(
|
|
100
103
|
branchesListPattern,
|
|
101
104
|
(branchesList) => `${branchesList} paths-ignore:\n${pathsIgnoreLines}`,
|
|
@@ -107,7 +110,7 @@ const writeWorkflow = (outputName, template) => {
|
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
for (const [key, value] of Object.entries(withValues)) {
|
|
110
|
-
content += ` ${key}: ${
|
|
113
|
+
content += ` ${key}: ${formatYamlValue(value)}\n`;
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
|
package/package.json
CHANGED