@catladder/cli 0.0.0-refactor-resolve-references-90442171 → 0.0.0-refactor-resolve-references-af020709
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.
|
@@ -879,12 +879,14 @@ const bashExpressionType = {
|
|
|
879
879
|
// we create a BLOCK_LITERAL
|
|
880
880
|
// but because bash will interpret the value, it may resolve to a multiline string
|
|
881
881
|
// so we need to indent every line using sed
|
|
882
|
-
return "|-\n" +
|
|
882
|
+
return ("|-\n" +
|
|
883
|
+
ctx.indent +
|
|
884
|
+
indentNewlinesInBashExpression(node.value, ctx.indent));
|
|
883
885
|
},
|
|
884
886
|
identify: (v) => v instanceof BashExpression_1.BashExpression,
|
|
885
887
|
};
|
|
886
888
|
const indentNewlinesInBashExpression = (expression, indent) => {
|
|
887
|
-
return expression.transformWithCommand(`sed 's/^/${indent}/'`);
|
|
889
|
+
return expression.transformWithCommand(`sed '1!s/^/${indent}/'`);
|
|
888
890
|
};
|
|
889
891
|
const variableContainingReferences = {
|
|
890
892
|
tag: "",
|
|
@@ -897,7 +899,7 @@ const variableContainingReferences = {
|
|
|
897
899
|
const stringified = value.parts
|
|
898
900
|
.map((part) => part instanceof BashExpression_1.BashExpression
|
|
899
901
|
? indentNewlinesInBashExpression(part, ctx.indent)
|
|
900
|
-
: part.toString())
|
|
902
|
+
: part.toString().replace(/\n/g, `\n${ctx.indent}`))
|
|
901
903
|
.join("");
|
|
902
904
|
return "|-\n" + ctx.indent + stringified;
|
|
903
905
|
},
|
|
@@ -4047,12 +4047,14 @@ const bashExpressionType = {
|
|
|
4047
4047
|
// we create a BLOCK_LITERAL
|
|
4048
4048
|
// but because bash will interpret the value, it may resolve to a multiline string
|
|
4049
4049
|
// so we need to indent every line using sed
|
|
4050
|
-
return "|-\n" +
|
|
4050
|
+
return ("|-\n" +
|
|
4051
|
+
ctx.indent +
|
|
4052
|
+
indentNewlinesInBashExpression(node.value, ctx.indent));
|
|
4051
4053
|
},
|
|
4052
4054
|
identify: (v) => v instanceof BashExpression_1.BashExpression,
|
|
4053
4055
|
};
|
|
4054
4056
|
const indentNewlinesInBashExpression = (expression, indent) => {
|
|
4055
|
-
return expression.transformWithCommand(`sed 's/^/${indent}/'`);
|
|
4057
|
+
return expression.transformWithCommand(`sed '1!s/^/${indent}/'`);
|
|
4056
4058
|
};
|
|
4057
4059
|
const variableContainingReferences = {
|
|
4058
4060
|
tag: "",
|
|
@@ -4065,7 +4067,7 @@ const variableContainingReferences = {
|
|
|
4065
4067
|
const stringified = value.parts
|
|
4066
4068
|
.map((part) => part instanceof BashExpression_1.BashExpression
|
|
4067
4069
|
? indentNewlinesInBashExpression(part, ctx.indent)
|
|
4068
|
-
: part.toString())
|
|
4070
|
+
: part.toString().replace(/\n/g, `\n${ctx.indent}`))
|
|
4069
4071
|
.join("");
|
|
4070
4072
|
return "|-\n" + ctx.indent + stringified;
|
|
4071
4073
|
},
|
|
@@ -14,12 +14,14 @@ const bashExpressionType = {
|
|
|
14
14
|
// we create a BLOCK_LITERAL
|
|
15
15
|
// but because bash will interpret the value, it may resolve to a multiline string
|
|
16
16
|
// so we need to indent every line using sed
|
|
17
|
-
return "|-\n" +
|
|
17
|
+
return ("|-\n" +
|
|
18
|
+
ctx.indent +
|
|
19
|
+
indentNewlinesInBashExpression(node.value, ctx.indent));
|
|
18
20
|
},
|
|
19
21
|
identify: (v) => v instanceof BashExpression_1.BashExpression,
|
|
20
22
|
};
|
|
21
23
|
const indentNewlinesInBashExpression = (expression, indent) => {
|
|
22
|
-
return expression.transformWithCommand(`sed 's/^/${indent}/'`);
|
|
24
|
+
return expression.transformWithCommand(`sed '1!s/^/${indent}/'`);
|
|
23
25
|
};
|
|
24
26
|
const variableContainingReferences = {
|
|
25
27
|
tag: "",
|
|
@@ -32,7 +34,7 @@ const variableContainingReferences = {
|
|
|
32
34
|
const stringified = value.parts
|
|
33
35
|
.map((part) => part instanceof BashExpression_1.BashExpression
|
|
34
36
|
? indentNewlinesInBashExpression(part, ctx.indent)
|
|
35
|
-
: part.toString())
|
|
37
|
+
: part.toString().replace(/\n/g, `\n${ctx.indent}`))
|
|
36
38
|
.join("");
|
|
37
39
|
return "|-\n" + ctx.indent + stringified;
|
|
38
40
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bashYaml.js","sourceRoot":"","sources":["../../../../../pipeline/src/bash/bashYaml.ts"],"names":[],"mappings":";;;AACA,+BAAiC;AACjC,qDAAkD;AAClD,sGAAmG;AAEnG,MAAM,kBAAkB,GAAc;IACpC,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,oDAAoD;QACpD,OAAO,IAAI,+BAAc,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,SAAS,CAAC,IAAS,EAAE,GAAQ;QAC3B,4BAA4B;QAC5B,kFAAkF;QAClF,4CAA4C;QAC5C,OAAO,MAAM,GAAG,8BAA8B,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"bashYaml.js","sourceRoot":"","sources":["../../../../../pipeline/src/bash/bashYaml.ts"],"names":[],"mappings":";;;AACA,+BAAiC;AACjC,qDAAkD;AAClD,sGAAmG;AAEnG,MAAM,kBAAkB,GAAc;IACpC,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,oDAAoD;QACpD,OAAO,IAAI,+BAAc,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,SAAS,CAAC,IAAS,EAAE,GAAQ;QAC3B,4BAA4B;QAC5B,kFAAkF;QAClF,4CAA4C;QAC5C,OAAO,CACL,MAAM;YACN,GAAG,CAAC,MAAM;YACV,8BAA8B,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CACvD,CAAC;IACJ,CAAC;IAED,QAAQ,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,C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