Open quintesse opened 9 years ago
How is this exactly better than aliasing bash commands?
Literally speaking not much, but it would be a generic way to create those aliases across OSes, so instead of having to explain to people how to create a) aliases on Linux and MacOS and b) batch files on Windows and then how to add them to their startup scripts or path you can just show the command. A single cross-platform way of handling things. (You would have to set the PATH once, but a Ceylon installer could do that for you in the future) So IMHO: a lot better :)
I'd move this to 1.3, no?
Sure, no problem, I would like your opinion on this issue though :)
Well, I haven't understood why we're in the business of shipping non-ceylon commands ;)
Because we're in the business of allow people to write software? :)
And this is about commands written in Ceylon after all.
In no other way could a developer create a module Foo
that provides a command foo
to the user's system that easily.
I saw this done for NPM modules and it seems extremely useful to me.
Mmmm, I see what you mean, so it's sorta like Debian packages. Perhaps it makes sense, but I'm still not sold this isn't done better with a Debian package (well, you could argue that there are no such mechanisms for Windows, but still if I look at the nightmare that gem
is, I wonder if we'd be doing the right thing following that madness)
I would indeed say that heh :)
And honestly, making RPM packages is either doable but you'll have to distribute them yourself or you try to make RPM packages that can be officially distributed and then it suddenly becomes really hard.
I'm not really aware what madness gem
has created though. Would simply copying a shell/batch file to ~/.ceylon/osbin cause the same kind of problems?
Well, the madness is that we're using non-OS tools to install programs as opposed to expressing lib dependencies. It never works as well as OS tools.
Perhaps, but I'm not seeing anyone creating Ceylon-based packages for applications for Debian or RedHat any time soon.
And if you do ceylon run something.not.already.installed
then you're also installing a program, aren't you?
Besides, think of the cool demos you could do :)
$ ceylon command install org.example.imgconverter
$ imgconvert --add-ponies gavin.jpg gavin-with-ponies.png
Well, but then people are going to ask for scripts run before/after installation and all that OS packages provide, so where do we draw the line?
No no, right there, no other scripts please! hehe
Be able to do something like:
This is closely related to the
ceylon plugin
tool which allows you to install extensions to theceylon
command. But instead of installing a sub-command for the main Ceylon tool it would install a completely independent script.The way I would imagine this to work is to create/copy a *nix shell script or a Windows batch file to
~/.ceylon/osbin/mymodule
that would contain something likeceylon run mymodule/1.0.0 "$@"
so that the user could just typemymodule
to execute the tool (assuming~/.ceylon/osbin
was added to the user'sPATH
of course).We could do the same for the system level, just like we do for plugins and copy create/copy the script in
/etc/ceylon/osbin
(or the corresponding folders for Windows/Mac).Now, the easiest way to implement this would be to re-use the current machinery that's already in place for dealing with plugins. For example, right now we require that you have a
ceylon-example
script in yourscript
folder to create aceylon example
command. We could extend that in such a way that if you create aosbin-example
script it will copy that to the user'sPATH
.Thing is, it might be the easiest way, but I don't think these commands have anything to do with plugins, which might confuse people. But on the other hand I don't think it's worth it to make an entirely new system (with a new repository artifact type etc) just for 1 or 2 files that some module might include.
Possible solutions:
ceylon plugin
tool toceylon command
plugin
machinery and just create a tool (ceylon command
) that can create those files on the fly (they are bound to be mostly the same anyway, just the name of the module would change)