mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-19 01:15:11 -04:00
Don't run ls if using non-default directory
Previously, an error message would appear if using a non-default directory because it would run `ls` on the non-existent default directory: ```bash ls: cannot access '/home/nicolas/Library/Application Support/Firefox/Profiles/*.default/places.sqlite': No such file or directory ```
This commit is contained in:
parent
935dcac0c7
commit
c834b2ef13
1 changed files with 2 additions and 2 deletions
|
@ -6,10 +6,10 @@ mkdir -p "$REPO_DIR/output/sources"
|
||||||
|
|
||||||
if [[ "$1" == "--chrome" ]]; then
|
if [[ "$1" == "--chrome" ]]; then
|
||||||
# Google Chrome / Chromium
|
# Google Chrome / Chromium
|
||||||
default=$(ls ~/Library/Application\ Support/Google/Chrome/Default/History)
|
|
||||||
if [[ -e "$2" ]]; then
|
if [[ -e "$2" ]]; then
|
||||||
cp "$2" "$REPO_DIR/output/sources/chrome_history.db.tmp"
|
cp "$2" "$REPO_DIR/output/sources/chrome_history.db.tmp"
|
||||||
else
|
else
|
||||||
|
default=$(ls ~/Library/Application\ Support/Google/Chrome/Default/History)
|
||||||
echo "Defaulting to history db: $default"
|
echo "Defaulting to history db: $default"
|
||||||
echo "Optionally specify the path to a different sqlite history database as the 2nd argument."
|
echo "Optionally specify the path to a different sqlite history database as the 2nd argument."
|
||||||
cp "$default" "$REPO_DIR/output/sources/chrome_history.db.tmp"
|
cp "$default" "$REPO_DIR/output/sources/chrome_history.db.tmp"
|
||||||
|
@ -22,10 +22,10 @@ fi
|
||||||
|
|
||||||
if [[ "$1" == "--firefox" ]]; then
|
if [[ "$1" == "--firefox" ]]; then
|
||||||
# Firefox
|
# Firefox
|
||||||
default=$(ls ~/Library/Application\ Support/Firefox/Profiles/*.default/places.sqlite)
|
|
||||||
if [[ -e "$2" ]]; then
|
if [[ -e "$2" ]]; then
|
||||||
cp "$2" "$REPO_DIR/output/sources/firefox_history.db.tmp"
|
cp "$2" "$REPO_DIR/output/sources/firefox_history.db.tmp"
|
||||||
else
|
else
|
||||||
|
default=$(ls ~/Library/Application\ Support/Firefox/Profiles/*.default/places.sqlite)
|
||||||
echo "Defaulting to history db: $default"
|
echo "Defaulting to history db: $default"
|
||||||
echo "Optionally specify the path to a different sqlite history database as the 2nd argument."
|
echo "Optionally specify the path to a different sqlite history database as the 2nd argument."
|
||||||
cp "$default" "$REPO_DIR/output/sources/firefox_history.db.tmp"
|
cp "$default" "$REPO_DIR/output/sources/firefox_history.db.tmp"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue