Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Default domain listing to current directory
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Jun 26, 2014
1 parent 5679a33 commit 7dbd185
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/domains/latest/all.sh
@@ -1,19 +1,17 @@
#!/usr/bin/env bash
set -e

domainroot="$PWD/${1%/}"
domainroot="${1%/}"
domainroot="${domainroot:-$PWD}"
domainroot=$(cd "$domainroot"; echo "$PWD")

cd "$(dirname $0)"

domainpaths=$(find "$domainroot" ! -path "$domainroot" -type d)
domainpaths=$(find "$domainroot" -type d ! -path "$domainroot")

for domainpath in $domainpaths;
do
newest=$(./single.sh $domainpath)
newest=$("${BASH_SOURCE%/*}/single.sh" "$domainpath")

if [[ -e "$newest" ]]; then
echo "$newest"
fi
done

cd - > /dev/null
4 changes: 3 additions & 1 deletion src/domains/latest/single.sh
Expand Up @@ -2,8 +2,10 @@
set -e

domainpath="${1%/}"
domainpath="${domainpath:-$PWD}"
domainpath=$(cd "$domainpath"; echo "$PWD")

newest=$(find $domainpath -type f | sort | tail -1)
newest=$(find "$domainpath" -type f | sort | tail -1)

if [[ -e "$newest" ]]; then
echo "$newest"
Expand Down

0 comments on commit 7dbd185

Please sign in to comment.