Skip to content

Commit

Permalink
chore(dev-utils): Added simple sass-migrator command
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Aug 13, 2021
1 parent d8c3f12 commit a8e8df3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dev-utils/src/cli.ts
Expand Up @@ -11,6 +11,7 @@ import { libsize } from "./libsize";
import { release, RELEASE_TYPES, toReleaseType } from "./release";
import { sandbox } from "./sandbox";
import { sassdoc } from "./sassdoc";
import { sassMigrator } from "./sassMigrator";
import { shared } from "./shared";
import { themes } from "./themes";
import { typedoc } from "./typedoc";
Expand Down Expand Up @@ -205,4 +206,6 @@ createCommand("typedoc")
)
.action(() => typedoc());

createCommand("migrate").action(() => sassMigrator());

program.parse(process.argv);
14 changes: 14 additions & 0 deletions packages/dev-utils/src/sassMigrator.ts
@@ -0,0 +1,14 @@
import { exec } from "child_process";
import { promisify } from "util";

import { glob } from "./utils";

const execPromise = promisify(exec);

export async function sassMigrator(): Promise<void> {
const files = await glob("packages/!(documentation)/src/**/*.scss");

await Promise.all(
files.map((file) => execPromise(`sass-migrator division ${file}`))
);
}

0 comments on commit a8e8df3

Please sign in to comment.