Pre/post publish commands
Defining custom commands that are executed when the publish process starts or finishes is now doable through the Coherent Prysm's panel or the project structure.
How to add custom commands?
The feature location is inside the Document tab -> Configuration accordion.
There are two ways to add custom commands - through the project feature and the document.
Document
Firstly you need to open the editor from some of the two buttons:
Then the commands text editor will be opened where you can edit your commands.
Note that each command should be defined on a new line!
After you defined your commands save them by clicking onto the "Save commands" button or simply press the Ctrl+S
keyboard combination.
Project
Via the project structure feature you can define pre/post publish commands by prePublishCommands
and postPublishCommands
keys that are accepting array with string values where each string is accepted as command.
To preview the commands coming from the project you can open the commands editor from the following buttons:
-
Commands for the current document coming from the project config
-
Commands for all the documents coming from the project config
How the commands are executed?
Each command is executed in a new shell. The current working directory (CWD) of the shell by default is the directory of the currently opened .fla document. You can't overwrite the CWD of a command from the panel but you can construct relative paths to the fla, project, or output directory inside each command that might be helpful. For this purpose you can use the preset aliases.
Preset aliases
With these aliases, you can define commands that are depending on relative paths to the current document, project file, or output directory. They are resolved runtime right before each command execution.
All the supported aliases can be found inside the commands editor table.
When the commands are executed?
- Pre-publish commands - They are executed right before the process of generating the HTML content starts.
- Post-publish commands - They are executed after the process of generating the HTML content finishes.
Pre/post commands loader
When execution of the pre/post publish commands start then a loader will be displayed showing the progress of the executed commands. If there is a command that has stalled or is taking a long time you can stop the publishing process from the "Cancel" button.
When the "Cancel" button is clicked a toast will be displayed notifying for the publish process abortion.
Commands log
The log from each command is available in Prysm's log file that is created inside the %TEMP%
folder with the name coherent_prysm_log.log
. You can also access the file by clicking on the "Info" button inside the status toast shown after each publish.
If some command finished with an error then the publish status toast will be displayed notifying about the problem. You can open the log file to check the errors from the commands.