Comments (2)
In both cases, you are using sync functions, which wouldn’t work. It will work if you turn them into async using util.promisify
import { intro, outro, spinner } from '@clack/prompts';
import { promisify } from "node:util";
import shell from "shelljs";
const exec = promisify(shell.exec);
intro(`No spinner on shell.exec`);
const s = spinner();
s.start('Running install');
const command = await exec('pnpm install', { silent: true }).catch(() => ({code: 1}));
const message = command.code === 0 ? "Installtion successful" : "Installation failed";
s.stop(message, command.code);
outro(`done`);
from clack.
Nodes normal exec is also not workin...
import { intro, outro, spinner } from '@clack/prompts';
import { execSync } from "node:child_process";
intro(`No spinner on execSync`);
const s = spinner();
s.start('Running install');
const command = execSync('npm install', { stdio: null });
const message = command.code === 0 ? "Installtion successful" : "Installation failed";
s.stop(message, command.code);
outro(`done`);
from clack.
Related Issues (20)
- [Request] Disable continuous terminal rewriting in CI HOT 1
- [Bug] Has anyone been able to get the @clack/prompts example working with Bun? HOT 4
- To allow the possibility of adding a JavaScript object as a value in a select value
- [Bug] Long select list glitches HOT 1
- [Request] May you give a release to take the feature [clear process listener in spinner](https://github.com/natemoo-re/clack/commit/8a6315eb39e83951676e3e61e32b6acec784f30c)
- [Bug] Keyboard input not working after await in spinner HOT 7
- [Request] p.info HOT 2
- [Bug] Typescript Select option value warning HOT 2
- Release new version HOT 5
- [Request] Setting up Elm projects as well
- [Request] `Select` or `Multi-Select` provide `disable` option in `@clack/prompts`
- [Request] release version need tasks api HOT 3
- [Request] use clack text to develop a cli supporting command history
- Dynamic message
- [Bug] group HOT 3
- [Bug] ERR_TTY_INIT_FAILED on git bash (MINGW64)
- [Bug] MultiSelectOptions cursorAt not working, Select Missing this
- [Request] Pass custom `stdin` to prompts
- [Bug] multiselect only shows the hint on the first item in the options
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clack.