Skip to content

Commit

Permalink
#137 - user's custom functions in tagui_custom.js
Browse files Browse the repository at this point in the history
This commit adds support for letting users create a tagui_custom.js file in tagui/src folder, which they can define global helper functions for use in their automation scripts.

tagui_custom.js will persist with newer TagUI releases as there isn't a tagui_custom.js file as part of the repo.
  • Loading branch information
kensoh committed Apr 16, 2018
1 parent f7b8c2a commit f53534a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/tagui_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -1198,4 +1198,3 @@ function getTimeoutAndCheckNextStepFunction(timeout, then, methodName, defaultTi
return timeout;
}

// flow path for save_text and snap_image
8 changes: 8 additions & 0 deletions src/tagui_parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
while(!feof($config_file)) {fwrite($output_file,fgets($config_file));} fclose($config_file);
while(!feof($header_file)) {fwrite($output_file,fgets($header_file));} fclose($header_file);

// append custom functions file created by user if the file exists
if (file_exists('tagui_custom.js')) {
$custom_file = fopen('tagui_custom.js','r') or die("ERROR - cannot open tagui_custom.js" . "\n");
while(!feof($custom_file)) {fwrite($output_file,fgets($custom_file));} fwrite($output_file,"\n"); fclose($custom_file);}

// append comment on flow path variable in casperjs script
fwrite($output_file,"// flow path for save_text and snap_image\n");

// save flow path in casperjs script to be used by save_text and snap_image
// casperjs/phantomjs do not seem to support \ for windows paths, replace with / to work
// below marker for appending url_intent when flow file does not start with comments or url
Expand Down

0 comments on commit f53534a

Please sign in to comment.