Skip to content

Commit 823539b

Browse files
committed
before final commit
1 parent 2a10c96 commit 823539b

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"bin": "lib/bin/json2scss",
77
"scripts": {
88
"test": "make test",
9-
"prepare": "npm test"
9+
"prepare": "npm test",
10+
"postpublish" : "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$PACKAGE_VERSION && git push --tags"
1011
},
1112
"keywords": ["sass", "JSON","scss","next","dart-scss","colors", "HEX", "HSL", "RGB", "Color Lavel 4"],
1213
"author": "AS Developers",

src/bin/json2scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ let argv = minimist(process.argv.slice(2), {
1515
h: 'help',
1616
p: 'prefix',
1717
s: 'suffix',
18+
cc: 'colorConversion',
19+
ct: 'convertTo',
20+
cl4: 'cl4Syntax'
1821
},
19-
default: { i: '-', o: '-' }
22+
default: { i: '-', o: '-', cc: true, ct: 'hsl', cl4: false }
2023
});
2124

2225
if (argv.help) showHelp(0);
@@ -46,6 +49,9 @@ let opts = {};
4649

4750
if (argv.prefix) opts.prefix = argv.prefix;
4851
if (argv.suffix) opts.suffix = argv.suffix;
52+
if (argv.colorConversion) opts.colorConversion = argv.colorConversion;
53+
if (argv.convertTo) opts.convertTo = argv.convertTo;
54+
if (argv.cl4Syntax) opts.cl4Syntax = argv.cl4Syntax;
4955

5056
input.pipe(json2scss(opts)).pipe(output);
5157

usage.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ usage: json-to-sass {OPTIONS}
44
-o, --outfile Write output to a file. Default: "-" (stdout)
55
-p, --prefix Add some text to the beginning.
66
-s, --suffix Add some text to the end. Default: ";"
7-
-cl4, --cl4Syntax This allows the Color Convertion to new Color Space separated Syntax. Default: false
7+
-cc, --colorConversion This enables colorConversion, if you don't need any conversion at all you need to make it false. Default: true
8+
-ct, --convertTo This allows the Color Convertion to new HSL, RGB, or HEX completely. Default: 'hsl'
9+
-cl4, --cl4Syntax This allows the Color Convertion to new Color Space separated Syntax. Default: false
810
-h, --help Show this message.

0 commit comments

Comments
 (0)