Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue of space in a folder or filename breaking PJS on Windows - done #987

Closed
kensoh opened this issue Mar 26, 2021 · 8 comments
Closed
Assignees
Labels

Comments

@kensoh
Copy link
Member

kensoh commented Mar 26, 2021

source - telegram group chat

@kensoh kensoh self-assigned this Mar 26, 2021
@kensoh kensoh added the query label Mar 26, 2021
@kensoh kensoh changed the title Revisit whether the issue of space in a folder or filename breaks PJS Revisit whether the issue of space in a folder or filename breaks PJS and solution Mar 26, 2021
@kensoh
Copy link
Member Author

kensoh commented May 21, 2021

macOS / Linux
space in flow filename - OK
space in flow folder name - OK
space in folder path to tagui - OK

Windows
space in flow filename - CasperJS has problem passing filename to PhantomJS
space in flow folder name - CasperJS has problem passing filename to PhantomJS
space in folder path to tagui - OK

@kensoh
Copy link
Member Author

kensoh commented May 21, 2021

Digging further for Windows on the root cause of CJS not passing correctly to PJS,
https://stackoverflow.com/questions/42069477/how-casperjs-passing-arguments-with-space

@kensoh kensoh added feature and removed query labels May 21, 2021
@kensoh kensoh changed the title Revisit whether the issue of space in a folder or filename breaks PJS and solution Revisit whether the issue of space in a folder or filename breaks PJS - done May 21, 2021
@kensoh
Copy link
Member Author

kensoh commented May 21, 2021

Above commit now allows folders and filenames with spaces on all OSes. You can download the latest copy of TagUI with this fix and unzip to overwrite your existing installation (please drag the folders under tagui\src to overwrite your existing installation) - https://github.com/kelaberetiv/TagUI/archive/master.zip

In the next release, this fix will become part of the packaged zip files.

Fyi @ruthtxh found a workaround for it. Solution doesn't make sense but seems to work. No change for now on your MS Word plug-in. Because this isn't released yet as part of packaged release.

@kensoh kensoh changed the title Revisit whether the issue of space in a folder or filename breaks PJS - done Fix issue of space in a folder or filename breaking PJS on Window - done May 21, 2021
@kensoh kensoh changed the title Fix issue of space in a folder or filename breaking PJS on Window - done Fix issue of space in a folder or filename breaking PJS on Windows- done May 21, 2021
@kensoh kensoh changed the title Fix issue of space in a folder or filename breaking PJS on Windows- done Fix issue of space in a folder or filename breaking PJS on Windows - done May 21, 2021
kensoh added a commit to tebelorg/TagUI that referenced this issue May 22, 2021
@kensoh
Copy link
Member Author

kensoh commented Jun 8, 2021

Reopening to handle space in subflows??

@kensoh kensoh changed the title Fix issue of space in a folder or filename breaking PJS on Windows - done Fix issue of space in a folder or filename breaking PJS on Windows - check subflow Jun 8, 2021
@kensoh
Copy link
Member Author

kensoh commented Jun 8, 2021

Seems to be ok, just need to wrap in double quotes from Word plugin side when calling tagui from command line.

function expand_intent($script_line, $indentation_for_tagui_step) { // function to call other scripts for reusability
if ((strpos(strtolower(trim($script_line)),'tagui ') === 0) or (strtolower(trim($script_line)) == 'tagui')) {
$params = trim(substr(trim($script_line)." ",1+strpos(trim($script_line)." "," "))); if ($params == "")
die("ERROR - filename missing for step " . trim($script_line) . "\n");
else if (!file_exists(abs_file($params)))
die("ERROR - file not found for step " . trim($script_line) . "\n");
else {$indentation_for_tagui_step .= str_replace(ltrim($script_line),'',$script_line);
$expanded_intent = ""; $temp_input_file = fopen(abs_file($params),'r'); if ($temp_input_file == false)
die("ERROR - cannot open file for step " . trim($script_line) . "\n");
while(!feof($temp_input_file)) {$expanded_intent .= expand_intent(fgets($temp_input_file),$indentation_for_tagui_step);}
fclose($temp_input_file); return $expanded_intent;}} else return $indentation_for_tagui_step . rtrim($script_line) . "\n";}

@kensoh kensoh changed the title Fix issue of space in a folder or filename breaking PJS on Windows - check subflow Fix issue of space in a folder or filename breaking PJS on Windows - done Jun 8, 2021
@kensoh
Copy link
Member Author

kensoh commented Jun 8, 2021

above commit prevents some error on Windows due to space in filename being treated by for command as 2 parameters

@kensoh
Copy link
Member Author

kensoh commented Jun 8, 2021

Users can download the latest copy of TagUI with this fix and unzip to overwrite your existing installation (please drag the folders under tagui\src to overwrite your existing installation) - https://github.com/kelaberetiv/TagUI/archive/master.zip

In the next release, this fix will become part of the packaged zip files.

@kensoh
Copy link
Member Author

kensoh commented Jun 18, 2021

Closing issue, change included in latest packaged release - https://github.com/kelaberetiv/TagUI/releases/tag/v6.46.0

@kensoh kensoh closed this as completed Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant