You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
793 B
Bash
27 lines
793 B
Bash
#!/usr/bin/env bash
|
|
########################################################################
|
|
# Copyright 2014 Lukas Bestle <project-projectr@lukasbestle.com>
|
|
# License MIT
|
|
########################################################################
|
|
# Lists all known project directories.
|
|
#
|
|
# Usage: project_list
|
|
########################################################################
|
|
|
|
# Determine the path to the projects file
|
|
configPath=${XDG_CONFIG_HOME:-$HOME/.config}
|
|
if [[ -d "$configPath/projectr" ]]; then
|
|
projectsFile="$configPath/projectr/projects"
|
|
else
|
|
projectsFile="$HOME/.projects"
|
|
fi
|
|
|
|
# Check if the projects file exists
|
|
if [[ ! -f "$projectsFile" ]]; then
|
|
echo -e "\033[31mThere is no \033[34m$projectsFile\033[31m file yet.\033[0m" >&2
|
|
exit 1
|
|
fi
|
|
|
|
cat "$projectsFile"
|
|
exit $?
|