Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a Scripts folder where I keep Automator actions, Applescripts, and shell scripts. Automator scripts are automatically assigned a version of 1.1.1 it seems. When I make revisions to any of these kinds of documents, how can I manually set the versions so that info will display in the finder, either with Get Info or in a folder list with Version view enabled?

Especially in the case of shell scripts (zsh), is there a comment format where I can enter the version of the script and Finder will see it? Or is there a way to associate an editable system resource to the scripts that will make the script version visible?

share|improve this question
    
For a shell script, the answer is "not really". Automator scripts are application bundles, and the version is set at Contents > Info.plist, with <key>CFBundleShortVersionString</key> <string>1.1.1</string> ; this can be manually changed if for some reason you want to use a version number different from what Automator has assigned. But to set the Finder version info for a shell script would be extremely unwieldy or impractical, probably involving making a phony application bundle for Finder to look at. I was hoping it would be as easy as using xattr somehow. –  Elliott Feb 16 '13 at 1:32

1 Answer 1

Finder does not keep track of versions as it just represents the file system which under HFS+ does not keep versions.

I don;t see how to do exactly what you want but I think a way that would work is to use version control as used by programmers - I use this for control of my shell and other scripts. Examples of this are git, mercurial, svn(subversion) with various GUIs available e.g. SourceTree (for all three).

Git and mercurial work by s saving a set of changes across all files in a project which when you need more than one file you will find is needed. This snapshot of files can be tagged with a name e.g. 1.0.0 etc. Each change is individually labelled with a version control assigned name. The version data is kept in metadata in the version control system and not in the files as putting the version number in the files was found not to be useful. The GUI can browse over the file system and can show the change history.

share|improve this answer
    
Where does this version data get written to in the file? It seems like I should be able to locate that string and change in emacs or whatever? I'm only a total beginner to shell scripting and programming so I hadn't looked into true version control yet, it seems intimidating and perhaps overkill for the level I'm at, but maybe I should give it a look since it's inevitable. Thank you –  Elliott Feb 1 '13 at 21:28
    
Yes start with version control see this Progammer' question and this but best search for a tutorial –  Mark Feb 1 '13 at 21:53
    
Excellent links, thank you –  Elliott Feb 1 '13 at 22:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.