websolete
05/11/2022, 2:38 PM"scripts":{
"preServerStart":"cp \"\\\\servername\\folder\\subfolder\\\" \".\\certs\\\""
}
works:
"scripts":{
"preServerStart":"cp \"T:\\folder\\subfolder\\\" \".\\certs\\\""
}
where T: is simply mapped to \\servername\
is there some special syntax i'm missing for using unc paths here?thisOldDave
05/11/2022, 3:02 PMwebsolete
05/11/2022, 3:03 PMwebsolete
05/11/2022, 3:03 PMwebsolete
05/11/2022, 3:05 PMDave Merrill
05/11/2022, 3:07 PMwebsolete
05/11/2022, 3:08 PMRodney
05/11/2022, 3:08 PMwebsolete
05/11/2022, 3:09 PMDave Merrill
05/11/2022, 3:09 PMwebsolete
05/11/2022, 3:10 PMwebsolete
05/11/2022, 3:10 PMwebsolete
05/11/2022, 3:16 PMwebsolete
05/11/2022, 3:16 PMDave Merrill
05/11/2022, 3:16 PMwebsolete
05/11/2022, 3:17 PMDave Merrill
05/11/2022, 3:17 PMwebsolete
05/11/2022, 3:17 PMDave Merrill
05/11/2022, 3:18 PMDave Merrill
05/11/2022, 3:19 PMwebsolete
05/11/2022, 3:19 PMthisOldDave
05/11/2022, 3:20 PMwebsolete
05/11/2022, 3:21 PMwebsolete
05/11/2022, 3:21 PMbdw429s
05/11/2022, 3:27 PMbdw429s
05/11/2022, 3:28 PM\\servername
and when run from the CLI, since \
is an escape char, the command needs to become
cp \\\\servername ...
and when stored in JSON, where \
is also an escape char, the JSON string needs to become
"cp \\\\\\\\servername ..."
Dave Merrill
05/11/2022, 3:29 PMwebsolete
05/11/2022, 3:29 PM"preServerStart":"cp \"\\\\server\\folder1\\folder2\\folder3\\\" \".\\certs\\\""
bdw429s
05/11/2022, 3:29 PM--verbose
server start, it should output the preServerStart
command and you should see it with too few slasheswebsolete
05/11/2022, 3:29 PMbdw429s
05/11/2022, 3:29 PMbdw429s
05/11/2022, 3:30 PM"
but CLi commands can use '
to demarcate a stringwebsolete
05/11/2022, 3:30 PMbdw429s
05/11/2022, 3:30 PMbdw429s
05/11/2022, 3:31 PMbdw429s
05/11/2022, 3:31 PMwebsolete
05/11/2022, 3:31 PMbdw429s
05/11/2022, 3:31 PMbdw429s
05/11/2022, 3:31 PMbdw429s
05/11/2022, 3:32 PM\\\\
)bdw429s
05/11/2022, 3:33 PMls \\\\192.168.1.197\C$
websolete
05/11/2022, 3:33 PMbdw429s
05/11/2022, 3:33 PMbdw429s
05/11/2022, 3:34 PMcp \\foo
in your logs, then that means you're only REALLY running cp \foo
bdw429s
05/11/2022, 3:34 PMcp
uses file globs, it won't complain if the file glob matches nothingbdw429s
05/11/2022, 3:35 PMwebsolete
05/11/2022, 3:35 PMbdw429s
05/11/2022, 3:35 PMwebsolete
05/11/2022, 3:35 PMbdw429s
05/11/2022, 3:36 PMbdw429s
05/11/2022, 3:36 PMbdw429s
05/11/2022, 3:36 PMwebsolete
05/11/2022, 3:36 PMwebsolete
05/11/2022, 3:36 PMbdw429s
05/11/2022, 3:36 PMbdw429s
05/11/2022, 3:37 PM\
IF AND ONLY IF it's preceding a character that needs escapingbdw429s
05/11/2022, 3:37 PM\A
\B
\C
all day long and it won't carebdw429s
05/11/2022, 3:37 PM\
itself requires escaping, so \\
matters nowwebsolete
05/11/2022, 3:37 PMbdw429s
05/11/2022, 3:37 PMC:\\windows\\foo\\bar
etcbdw429s
05/11/2022, 3:38 PMbdw429s
05/11/2022, 3:39 PM\t
and \n
escpares for tabs and new lines in older versions of CommandBox because they caused too much troublebdw429s
05/11/2022, 3:39 PMC:\foo\temp
turned into C:\foo emp
!bdw429s
05/11/2022, 3:40 PM\
to be escaped regardless of what char it preceedswebsolete
05/11/2022, 3:42 PMbdw429s
05/11/2022, 3:43 PMsubfolder\*
bdw429s
05/11/2022, 3:45 PMcp
command doesn't output every file (since there could be thousands) but as long as it copies at least one file, you'll see
File copied to ....
bdw429s
05/11/2022, 3:46 PM--dryRun
flag comes in super handy so it doesn't take as long to testbdw429s
05/11/2022, 3:46 PMwebsolete
05/11/2022, 3:47 PMbdw429s
05/11/2022, 3:50 PMls path
to the package script to see what files its finding. Also, quoting arguments in CommandBox is only necessary if there is a space or a special char like =
inside the string. Looking at the real paths in your screenshot you DM'd me, you should be fine leaving off the quotes for readability.websolete
05/13/2022, 3:13 PM