Zipping an application package by script

Stephen Barncard stephenREVOLUTION2 at barncard.com
Wed Sep 10 15:30:25 EDT 2008


Mark, thanks for your suggestions.

  I do know about the terminal, and I have read the man page on zip 
several days ago.

As I mentioned at the start of this thread, using zip in the shell 
for me has ended up in zip not digging identical filenames like 
.DS_store or info.plist  (in different folders ) and stopping 
execution.

  Rather than think about some kind of pre-cleaner to remove or change 
them (why should I )  I had moved on after 20 minutes.

>I bet you could do it all with the lowercase r flag.

which was what I was doing:

put  "zip -r -jj" into zCommand
put "/Users/barncard/STANDALONES/55.app/" into ToBeZippdFolder

put  "/Users/barncard/Desktop/archive/" into zipfolder
replace space with "\" & space in zipfolder
replace space with "\" & space in ToBeZippdFolder

put shell( zCommand && ToBeZippdFolder && ToBeZippdFolder) into fld "output"

and got this result:

zip warning: name in zip file repeated: Info.plist
zip error: Invalid command arguments (cannot repeat names in zip file)

What I have been looking for here, is an all-rev solution -- and it 
appears that I was wrong in assuming that one couldn't build a 
complex file and folder structure inside revZip.  As it turns out, 
Trevor Devore just sent me a  recursive handler using strictly revZip 
commands that I think do what I want.


>On Sep 10, 2008, at 10:30 AM, Stephen Barncard wrote:
>
>>Thanks Mark, but my current need is to <compress> a folder and its 
>>contents by script control.
>>
>>However this little snippet is going into my code scrapbook for sure!
>>
>>sqb
>
>
>Hi Stephen,
>
>The Terminal is our friend.  All you have to do is man the zip 
>command in Terminal.  It will provide you a list of flags that will 
>allow you to do what you want.  It would probably take you no more 
>than 20 minutes to determine which flags you need.  My quick search 
>on the topic brought up: 
><http://forums.macosxhints.com/archive/index.php/t-53258.html>
>The man for zip on OS X can be read here: <http://www.manpagez.com/man/1/zip/>
>
>I bet you could do it all with the lowercase r flag.

which was what I was doing:

put  "zip -r -j" into zCommand
put "/Users/sbarncar/Projects/2007 Projects/C H A T E A 
U/STANDALONES/CHATEAU WIRE 55 REV 
3.0/chateauWire55/chateauWire55.app/" into ToBeZippdFolder

put  "/Users/sbarncar/Desktop/chateauWire55/" into zipfolder
replace space with "\" & space in zipfolder
replace space with "\" & space in ToBeZippdFolder

put shell( zCommand && ToBeZippdFolder && ToBeZippdFolder) into fld "output"


>
>I do not favor the use of Automator for this solution.  You can do 
>it very cleanly with shell and it will be a lot faster than 
>Automator as well.  If this is for a commercial app, Automator will 
>be noisy, may cause things to flash on the screen, may break down 
>the road when Apple decides that its fling with Automator is over, 
>and break between OS updates.
>
>
>Mark Talluto
>http://www.canelasoftware.com
>

-- 


stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -





More information about the use-livecode mailing list