val / crun Goto Github PK
View Code? Open in Web Editor NEWCrystal Run : shebang wrapper for Crystal
License: Other
Crystal Run : shebang wrapper for Crystal
License: Other
Is there a way to install crun via a package manager or shards?
I don't like git cloning and running make manually; Is sth like cargo install --git https://github.com/sigmaSd/arabic-reshaper-rs
available?
PS: Does crun work with Crystal v1?
CI build fails because you use require "tempfile"
which has been removed
I think it should be safe to not call shards install
if there's already a lockfile. This saves a lot of time, especially if the network is slow.
diff --git a/src/build.cr b/src/build.cr
index 146acd3..448650b 100644
--- a/src/build.cr
+++ b/src/build.cr
@@ -20,7 +20,8 @@ module Crun
hash = Dir.cd(build_dir) do
if shards_yaml
build_shards_config
- hash = build_subprocess("shards", %w[install])
+ hash =
+ build_subprocess("shards", %w[install]) unless File.exists? "#{build_dir}/shards.lock"
end
hash || build_subprocess("crystal", ["build", "-o", build_path, SOURCE])
Thanks for this project.
In current master build_path is set to
@@build_path ||= "#{build_dir}/#{SOURCE_FILENAME}"
This means that build_path is likely to end with a .cr extension. In case binfmt support for .cr file has been enabled, crun will be called again when the cached compiled file is run
Process.exec(build_path, ARGS)
Adding an extra extension to ensure that cached compiled file does not end with a .cr extension should fix the problem
@@build_path ||= "#{build_dir}/#{SOURCE_FILENAME}.crystal"
I want to process some text stream with my program (the same program) as in :
echo "hello\nworld\n" | ./myprog.cr process-lines | ./myprog.cr process-columns
When using the crystal compiler like in #! usr/bin/env crystal
I got an error so following a issue
I found crun
. From the description I think it should handle my case but when using it
I found the following error :
Unhandled exception: Error deleting file '/home/ nieto/.cache/crun/writter.crystal.lock': No such file or directory (Errno)
Failed to raise an exception: END_OF_STACK
[0x55c92d246da6] ???
[0x55c92d201afb] __crystal_raise +43
[0x55c92d202af5] ???
[0x55c92d20b131] ???
[0x55c92d2067ac] ???
[0x55c92d205bff] ???
[0x55c92d21f46d] ???
[0x55c92d21d9a5] ???
[0x55c92d20429a] main +74
[0x7f8f791e309b] __libc_start_main +235
[0x55c92d20087a] _start +42
[0x0] ???
#!/usr/bin/env crun
while line = gets
puts line
end
or
#!/usr/bin/env crun
sleep 1
Example – Simple usage:
crun eval 'puts ARGV' -- 1 2 3
Example – Run crun with Kakoune:
$ crun eval %{
# ---
# kakoune:
# github: alexherbo2/kakoune.cr
# ---
require "kakoune"
...
} -- %val{session} %val{client}
Example – Run crun with Kakoune:
evaluate-commands %sh{
crun <<-'EOF'
# ---
# kakoune:
# github: alexherbo2/kakoune.cr
# ---
require "kakoune"
...
EOF
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.