zaaack / foy

A simple, light-weight, type-friendly and modern task runner for general purpose.
http://zaaack.github.io/foy
MIT License
268 stars 15 forks source link

[Question] Having trouble using foy #22

Closed JUSTIVE closed 2 months ago

JUSTIVE commented 4 months ago

Hi, I'm trying to use this library, but I'm having trouble with it. even with the basic example that Foy init gives, it does not work at all, which is

const { task, desc, option, fs } = require('foy')

  task('build', async ctx => {
    await ctx.exec('echo "hello world"')
  })

and does not print at all. tried changing command to something simple, also does not work at all. Am I missing something here?

for more information, I'm using node@20.

zaaack commented 4 months ago

@JUSTIVE Plz try this and run npx foy build again:

const { task, desc, option, fs,setGlobalOptions } = require('foy')
setGlobalOptions({ loading: false })
  task('build', async ctx => {
    await ctx.exec('echo "hello world"')
  })
zaaack commented 4 months ago

do you use windows?

JUSTIVE commented 4 months ago

@JUSTIVE Plz try this and run npx foy build again:

const { task, desc, option, fs,setGlobalOptions } = require('foy')
setGlobalOptions({ loading: false })
  task('build', async ctx => {
    await ctx.exec('echo "hello world"')
  })

still same, without any stdout prints. I'm using mac(apple silicon). tried on node, and also bun, same outputs.

JUSTIVE commented 2 months ago

figured out how it works. I had to pass another 'build' to execute properly. bun ./index.ts build was the solution I needed.