I was testing some CF stuff with a server installe...
# adobe
r
I was testing some CF stuff with a server installed via commandbox. I used cffeed and got an error. The error very clearly said that the package for cffeed wasn't installed, and I should run this command (cfp or some such) and add feed. I did that. It worked. I thought - cool - surely I have to restart, but let me try a quick reload of the page... and bam. it worked. this is just to say - damn nice job.
p
Relates to ACF moving to a package managed platform so you dont have a heavy base install: https://helpx.adobe.com/coldfusion/using/coldfusion-package-manager.html
r
i had heard of that, and had installed packages via the admin. this was the first time i saw the error msg clearly point it out
p
yea easy to do in CLI or Admin UI.
r
what i REALLY liked was the error gave me the full path to the cli. i hate having to hunt down where commandbox puts stuff
❤️ 1
p
haha commandbox rocks!
r
its been problematic for me on WSL - but -in general - yes
b
You don't need to know where CommandBox puts it
There is already a
cfpm
command in commandbox which magically funnels through to the correct cfpm binary for you
And it's better because it ensures a java home is et, which cfpm.bat won't work without
All you need to do is go to the web root in CommandBox and run
Copy code
cfpm install feeds
and it will find the correct cfpm.bat or cfpm.sh for that server home and execute it for you
And if you just put
Copy code
server set scripts.onServerInitialInstall="cfpm install feeds"
into your
server.json
it will just happen automatically when you start up your adobe server for the first time, and any time a fresh update installs.
😍 1
r
that assumes running box i assume. i dont 'run' box usually, just box server start. but nice to know. as i said, i appreciated the error msg including the ufll path to the cli
b
Well, I mean it's the same
Copy code
box cfpm install feeds
Whether you use the interactive shell with all it's glorious color coding, highlighting, tab completion, and bullet train, or just run one-off commands, it's the same feature really.
r
cool. again though - Adobe folks (which i guess is me too) - great job
👍 1
m
I would suggest you doing this via a server.json file so it is repeatable and anyone you share you codebase with doesn't have to think about what dependencies you have.
Copy code
{
  "app": {
    "cfengine": "adobe@2021"
  },
  "name": "MYAPPNAME",
  "scripts": {
    "onServerInstall": "cfpm install chart,sqlserver,mail,zip,pdf"
  }
}
r
done - im fixing to test on a new machine so, this will help
b
@Michael Schmidt I recommend using
onServerInitialInstall
instead.
onServerInstall
runs on every start, but initial install only runs the first time a fresh CF home is downloaded and unpacked which happens on first start and any updates to a new version. The one you showed will surely work, it's just a bit of unnecessary delay on every start.
m
Thank you @bdw429s I will change my code bases as I get to them...
👍 1