You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Nicolas Peltier <pe...@gmail.com> on 2018/08/30 13:11:10 UTC

Re: [proposal][scripting console] http API for terminal usage

gave it a try and i get something like
g! pipe:run echo /content/blah/us/en / children cq:Page
{"items":["/content/blah/us/en/new_test_page","/content/blah/us/en/name"],"size":2}

i had to switch from "|" to "/" as "|" is a "real" pipe and ironically it
will be difficult to pass sling resource through that one.

sending this now a few days before i push it in case someone has opinions
(you never know)

Le mer. 23 mai 2018 à 12:46, Robert Munteanu <ro...@apache.org> a écrit :

> On Wed, 2018-05-23 at 11:46 +0200, Nicolas Peltier wrote:
> > What i'm unclear now is wether we should go the route of a provider
> > for
> > scripting in general, or "just" pipe (which is my direct interest),
> > so
> > something like a command where first argument specify a context,
> > second is
> > the actual script
> > g! sling:script groovy println 'Hello World'
> > g! sling:script groovy-pipe
> > p.echo("/content/site").$("sling:resourceType='bar'").mv("/archives")
> >
> > or direct
> > g! pipe:run
> > echo("/content/site").$("sling:resourceType='bar'").mv("/archives")
>
> I would go with the second approach, unless there is a short-term plan
> to add more commands.
>
> If we get more gogo shell commands we can always refactor later.
>
> Robert
>