Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a runtime for cli execution #157

Merged
merged 2 commits into from
Jan 11, 2023
Merged

add a runtime for cli execution #157

merged 2 commits into from
Jan 11, 2023

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Jan 9, 2023

adds a copas cli command to directly run copas based code. Example:

#!/usr/bin/env copas

local count = 0
copas.timer.new {
  delay = 1,
  recurring = true,
  callback = function(self)
    count = count + 1
    print('hello world ' .. count)
    if count >= 5 then
      self:cancel()
    end
  end
}

Copas itself is exposed as a global. And the loop is automatically started.

The submodules are now lazy-loaded upon first use and are accessible through the copas module.

the submodules are now lazy-loaded upon first use.
the copas runtime script cli mimics the Lua cli.
@Tieske Tieske merged commit 6313484 into master Jan 11, 2023
@Tieske Tieske deleted the submodules branch January 11, 2023 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant