foundeo / toscript

Converts Tag based CFML to CFML Script
GNU General Public License v3.0
20 stars 9 forks source link

Don't ask for confirmation if a CFC is already script #28

Closed bdw429s closed 7 years ago

bdw429s commented 7 years ago

Don't ask the user if they want to convert a CFC, only to tell them it's already script. Parse it first and then if it's script but them. I would still out the message that it's been looked at, but perhaps hide it behind a --verbose flag since the output might get a little cray cray on a large app.

CommandBox:cfscript> cfscriptme ./
cfscript.me v0.1.4 built by Foundeo Inc.

    ___                      _
   / __)                    | |
 _| |__ ___  _   _ ____   __| |_____  ___
(_   __) _ \| | | |  _ \ / _  | ___ |/ _ \
  | | | |_| | |_| | | | ( (_| | ____| |_| |
  |_|  \___/|____/|_| |_|\____|_____)\___/
                                         inc.

Can I overwrite Application.cfc? (yes/no): y
+  (Already CFML Script): Application.cfc
Can I overwrite config\Application.cfc? (yes/no): y
+  (Already CFML Script): config\Application.cfc
Can I overwrite config\CacheBox.cfc? (yes/no): y
+  (Converted): config\CacheBox.cfc
Can I overwrite config\Coldbox.cfc? (yes/no): y
+  (Already CFML Script): config\Coldbox.cfc
Can I overwrite config\WireBox.cfc? (yes/no): y
+  (Converted): config\WireBox.cfc
Can I overwrite handlers\Main.cfc? (yes/no): y
+  (Converted): handlers\Main.cfc
Can I overwrite tests\Application.cfc? (yes/no): y
+  (Converted): tests\Application.cfc
Can I overwrite tests\specs\integration\MainBDDTest.cfc? (yes/no): y
+  (Already CFML Script): tests\specs\integration\MainBDDTest.cfc
Can I overwrite tests\specs\integration\MainTest.cfc? (yes/no): y
+  (Converted): tests\specs\integration\MainTest.cfc

Done. Bugs / Suggestions: https://github.com/foundeo/toscript/issues
pfreitag commented 7 years ago

Version 0.1.5 no longer asks to overwrite if the file is already script. You can use --force to skip all prompts. I decided not to add a --verbose flag at this time, probably something I will do in the future, if you want to create a separate ticket for that feel free.