Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
feat(buildsassoption): implement few option values
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jul 11, 2018
1 parent 88436b4 commit 9be56a5
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,25 @@ const buildSassOption = (context: ReturnType<typeof buildContext>, options: comm
case 'stdin':
break;
case 'style':
const style = styleOptions.indexOf(value);
if (style < 0) {
throw new Error(`Unexpected value '${value}' for style`);
}
sassOption.outputStyle = style;
break;
case 'lineNumbers':
sassOption.sourceComments = true;
break;
case 'loadPath':
sassOption.addIncludePath(value);
break;
case 'pluginPath':
sassOption.addPluginPath(value);
break;
case 'sourcemap':
break;
case 'omitMapComment':
sassOption.omitMapComment = true;
break;
case 'precision':
sassOption.precision = parseInt(value, 10);
Expand All @@ -104,7 +112,7 @@ const buildSassOption = (context: ReturnType<typeof buildContext>, options: comm
return sassOption;
};

(async () => {
const main = async () => {
const options = commandLineArgs(optionDefinitions, { camelCase: true });
const displayHelp = options.help || Object.keys(options).length === 0;
const displayVersion = options.version;
Expand All @@ -123,4 +131,13 @@ const buildSassOption = (context: ReturnType<typeof buildContext>, options: comm
const sassOption = buildSassOption(context, options);

sassOption.dispose();
};

(async () => {
try {
await main();
} catch (error) {
console.log(error);
process.exit(-1);
}
})();

0 comments on commit 9be56a5

Please sign in to comment.