laughedelic / gtm

:stopwatch: git task/time manager
86 stars 10 forks source link

Failed to source "" script error when running "gtm weekly-report" #76

Open trygub opened 9 years ago

trygub commented 9 years ago

gtm weekly-report /home/semen/bin/gtm: line 576: : No such file or directory Failed to source '' script

Line 576 is the last line in this code snipped:

# file with projects map and format options
file=""
[[ "$1" =~ --projects ]] && file=${2:?"Expected projects map file!"} && shift 2
source "$file"
laughedelic commented 9 years ago

Hi, the problem here is that you need a configuration file listing projects that you want to generate this report for. Sorry that it's not obvious from the help :sweat_smile:. Here is an example of such config:

#!/bin/bash

# I have all my projects in one place then located in org-name/repo-name subfolders
prefix="/Users/laughedelic/dev"

# here we define a function that dispatches projects
function project() {
case $1 in

# "scala" project: first line in the heading for this project, then a list of repositories
scala) echo """Scala_tools
ohnosequences/statika
ohnosequences/cosas
""" ;;

general) echo """General
ohnosequences/sbt-s3-resolver
ohnosequences/sbt-github-release
ohnosequences/nice-sbt-settings
laughedelic/literator
""" ;;

confs) echo """Conferences
bio4j/FOSDEM-2014
ohnosequences/IWBBIO-2014
laughedelic/biss2014
ohnosequences/JdBI2014
"""
esac
}

# this is just the list of projects you want to generate report for
# in the function above you can define all you projects, 
# but here choose only some of them and in particular order
projects=(
scala
confs
general
)

# this is optional, just tuning the format of the output:
week_format='## %s \n\n'
project_format='### %s \n\n'
repo_format='#. [_repo_](https://github.com/_repo_) \n'
commit_format='    + `[%h]` `_time_` — %s'
total_format='\n    In total: _human_time_\n'

And yes, I should improve this command, so that without config it generates report just for the current repository...