Kirby 3 way of exec-uting shell scripts, such as node scripts?


#1

Is there any Kirby 3 specific way of running shell scripts such as node scripts?

Thanks


#2

Do you want to run those scripts from Kirby (e.g. from the Panel), or manually while the site is in development?


#3

if you need a way to create one or more buttons in the panel linked to skripts easily consider my janitor plugin.


#4

@lukasbestle I want to run a script that creates a .ttf when a page is created on the panel, or when it is published or when the user presses a button. All of it on the live website, not during development.

Thanks , @bnomei, I will take a look at it!

So there is no Kirby 3 specific way of doing this?

Thank you


#5

Sure, there’s hooks to hook into events as you mentioned:

  • page created
  • page published

If you need a custom action with UI (e.g. “button”), you could use @bnomei’s janitor plugin, or cook up your own.

I’ve built a “queue plugin” which has a basic API for working with events in an async way, if you’ld need it (e.g. if the creation of that ttf file would take too long).


#6

There is nothing special about running scripts from Kirby. As Kirby is built with PHP, you can use the standard PHP exec() function. As @bnomei and @bvdputte wrote, you can use hooks or Panel plugins as triggers.


#7

Thanks @lukasbestle, I was thinking perhaps some helpers.
Thanks again