Page MenuHomeSealhub

cli.js
No OneTemporary

#!/usr/bin/env node
import { execSync } from "child_process";
import { setRepoName } from "./utils/setRepoName.js";
function runCommand(command) {
try {
execSync(`${command}`, { stdio: "inherit" });
} catch (e) {
console.error(`Failed to execute ${command}`, e);
return false;
}
return true;
}
const repoName = "Sealcode-module";
const newRepoName = (await setRepoName()) || "Sealcode-module";
console.log(`Directory created: '${newRepoName}'`);
const repoPath = `https://hub.sealcode.org/source/module-starter.git '${newRepoName}'`;
const gitCheckout = `git clone --depth 1 ${repoPath}`;
const installDependencies = `cd '${newRepoName}' && npm install`;
console.log(`Cloning of the repository '${repoName}' in process...`);
const checkedOut = runCommand(gitCheckout);
if (!checkedOut) process.exit(-1);
console.log(`Installing dependencies for '${newRepoName}'`);
const installedDependencies = runCommand(installDependencies);
if (!installedDependencies) process.exit(-1);
console.log(
"Installation completed! Check the README file for additional steps."
);

File Metadata

Mime Type
text/plain
Expires
Fri, Jul 4, 04:06 (18 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
799782
Default Alt Text
cli.js (1 KB)

Event Timeline