theme.sh 386 B

123456789101112131415161718192021222324252627
  1. if [ $# -lt 1 ]; then
  2. echo "usage: theme <theme>"
  3. exit -1
  4. fi
  5. themes=`find NatureSDK -type d -name Themes`
  6. if [ -z "$themes/$1" ]; then
  7. echo "Theme not found"
  8. exit -1
  9. fi
  10. op=`pwd`
  11. cd "$themes"
  12. for file in `ls "$1"`; do
  13. if [[ -e "$file" ]]; then
  14. if [[ "`readlink "$file"`" = "$1/$file" ]]; then
  15. continue
  16. else
  17. rm "$file"
  18. fi
  19. fi
  20. ln -s "$1/$file" "$file"
  21. done
  22. cd "$op"