UNPKG

webpup-cli

Version:

A package for creating WordPress block themes using the WebPup CLI.

37 lines (25 loc) 794 B
#! /usr/bin/env node // const utils = require("./utils"); import * as utils from "./utils.js"; import { program } from "commander"; program .arguments('<theme> [theme-name]') .exitOverride() .action((theme, themeName) => { if (theme === 'theme') { themeName = themeName || 'my-theme'; const root = process.cwd(); if (themeName.includes(".") || themeName.includes("/")) { console.log("Invalid theme name. Theme name should not contain '.' or '/'"); return; } utils.wpTheme(root, themeName); } }); try { program.parse(process.argv); } catch (error) { console.log("Usage: zip-cli theme [theme-name]"); console.log("Usage: zip-cli theme my-theme"); }