Skip to content

Commit

Permalink
Fixed symlink-files-to-hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
spencertipping committed May 13, 2012
1 parent e865416 commit a6058db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions examples/README
@@ -1,6 +1,2 @@
Small programs that make use of perlquery. Be sure to read the code before
running them, as many of them make destructive changes.

NOTE! Don't use symlink-files-to-hashes. It has a bad bug that causes it to
bork the symlinks for any files in subdirectories. (This has to do with
relative paths.)
4 changes: 2 additions & 2 deletions examples/symlink-files-to-hashes
Expand Up @@ -25,9 +25,9 @@ for line in $lines; do
sum=$(echo $line | awk '{print $1}')
file=$(echo $line | awk '{print $2}')

if [[ ! -L $file ]]; then
if [[ ! -L "$file" ]]; then
[[ -e sum ]] || (echo "creating md5($file) = $sum" && cp "$file" $sum)
rm $file && echo "symlinking $sum to $file" && ln -s $sum $file
rm "$file" && echo "symlinking $sum to $file" && ln -rs $sum "$file"
else
echo "skipping symlink $file"
fi
Expand Down

0 comments on commit a6058db

Please sign in to comment.