Skip to content

Commit

Permalink
add description to --help
Browse files Browse the repository at this point in the history
  • Loading branch information
fpetrakov committed Aug 28, 2022
1 parent 8f8e34e commit be086a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convert-to-oklch",
"version": "1.0.7",
"version": "1.0.8",
"description": "CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.",
"main": "./src/index.js",
"bin": {
Expand Down
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/usr/bin/env node
const { program } = require("commander");
const packageVersion = require("../package.json").version;
const postcss = require("postcss");
const fs = require("fs");
const plugin = require("./plugin");

program
.name("convert-to-oklch")
.description(
"CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.",
)
.version(packageVersion);

program.argument("<path>", "path to css files").action(async (path) => {
const css = fs.readFileSync(path, 'utf-8');
const css = fs.readFileSync(path, "utf-8");

const result = await postcss([plugin])
.process(css, { from: path })
Expand Down

0 comments on commit be086a5

Please sign in to comment.