From 1afa34f9606180173c60eb6044b87ab1e7c7a096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20M=C3=A9ly?= Date: Sun, 19 Mar 2017 09:22:55 +0100 Subject: [PATCH 1/5] show jarvis output in real time by default --- jarvis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis.sh b/jarvis.sh index d11b375..12fe32b 100755 --- a/jarvis.sh +++ b/jarvis.sh @@ -404,7 +404,7 @@ jv_start_in_background () { Jarvis has been launched in background To view Jarvis output: -tail -f jarvis.log +./jarvis.sh and select "View output" To check if jarvis is running: pgrep -lf jarvis.sh To stop Jarvis: @@ -512,7 +512,7 @@ if [ "$just_execute" == false ]; then if jv_is_started; then options=('Show Jarvis output' 'Stop Jarvis') case "$(dialog_menu 'Jarvis is already running\nWhat would you like to do? (Cancel to let it run)' options[@])" in - Show*) cat jarvis.log;; + Show*) tail -f jarvis.log;; Stop*) jv_kill_jarvis;; esac exit From 8e3892aaa347dedbe9ad707ad129ba0f8c7ca620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20M=C3=A9ly?= Date: Sun, 19 Mar 2017 09:59:45 +0100 Subject: [PATCH 2/5] added recorder to troubleshooting config header --- jarvis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis.sh b/jarvis.sh index 12fe32b..38a0091 100755 --- a/jarvis.sh +++ b/jarvis.sh @@ -547,7 +547,7 @@ if [ "$just_execute" == false ]; then fi [ "$rec_hw" != "false" ] && microphone=$(lsusb -d $(cat /proc/asound/card${rec_hw:3:1}/usbid) | cut -c 34-) || microphone="Default" echo -e "$_gray\n------------ Config ------------" - for parameter in jv_version jv_arch jv_os_name jv_os_version language play_hw rec_hw speaker microphone trigger_stt command_stt tts_engine; do + for parameter in jv_version jv_arch jv_os_name jv_os_version language play_hw rec_hw speaker microphone recorder trigger_stt command_stt tts_engine; do printf "%-20s %s \n" "$parameter" "${!parameter}" done echo -e "--------------------------------\n$_reset" From 48e7bf0cab6b0d6f2e40180dd7d593a6b3a87535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20M=C3=A9ly?= Date: Sun, 19 Mar 2017 19:58:55 +0100 Subject: [PATCH 3/5] beta branch selection in menu --- jarvis-config-default.sh | 1 + jarvis.sh | 7 +++++++ utils/menu.sh | 2 ++ utils/utils.sh | 6 ++++-- version.txt | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/jarvis-config-default.sh b/jarvis-config-default.sh index 4cd53fe..aaa4d28 100644 --- a/jarvis-config-default.sh +++ b/jarvis-config-default.sh @@ -4,6 +4,7 @@ conversation_mode=true dictionary="stt_engines/pocketsphinx/jarvis-dictionary.dic" gain="0" google_speech_api_key="" +jv_branch="master" phrase_failed="This command has returned an error" phrase_triggered="" phrase_welcome="Hello" diff --git a/jarvis.sh b/jarvis.sh index 38a0091..797edd8 100755 --- a/jarvis.sh +++ b/jarvis.sh @@ -110,6 +110,7 @@ configure () { 'dictionary' 'gain' 'google_speech_api_key' + 'jv_branch' 'language' 'language_model' 'trigger_mode' @@ -164,6 +165,12 @@ configure () { dictionary) eval "$1=\"$(dialog_input "PocketSphinx dictionary file" "${!1}")\"";; gain) eval "$1=\"$(dialog_input "Microphone gain\nCan be positive of negative integer, ex: -5, 0, 10...\nAdjust it by steps of 5, or less to finetune" "${!1}" true)\"";; google_speech_api_key) eval "$1=\"$(dialog_input "Google Speech API Key\nHow to get one: http://stackoverflow.com/a/26833337" "${!1}")\"";; + jv_branch) options=("master" "beta") + eval "$1=\"$(dialog_select "Repository branch to use for Jarvis updates\nRecommended: master" options[@] "${!1}")\"" + git checkout $jv_branch || { + jv_error "ERROR: an error has occured while checking out $jv_branch branch" + jv_press_enter_to_continue + };; program_startup) editor hooks/$1;; program_exit) editor hooks/$1;; entering_cmd) editor hooks/$1;; diff --git a/utils/menu.sh b/utils/menu.sh index 60554b1..d97e2e5 100644 --- a/utils/menu.sh +++ b/utils/menu.sh @@ -51,6 +51,7 @@ jv_main_menu () { "Conversation mode ($conversation_mode)" "Language ($language)" "Check Updates on Startup ($check_updates)" + "Repository Branch ($jv_branch)" "Usage Statistics ($send_usage_stats)") case "`dialog_menu 'Configuration > General' options[@]`" in Username*) configure "username";; @@ -61,6 +62,7 @@ jv_main_menu () { Conversation*) configure "conversation_mode";; Language*) configure "language";; Check*Updates*) configure "check_updates";; + Repository*Branch*) configure "jv_branch";; Usage*Statistics*) configure "send_usage_stats";; *) break;; esac diff --git a/utils/utils.sh b/utils/utils.sh index 69a0e37..ffb1689 100644 --- a/utils/utils.sh +++ b/utils/utils.sh @@ -323,10 +323,12 @@ jv_check_updates () { local force=${2:-false} # false default value if $2 is empty cd "$repo_path" local repo_name="$(basename $(pwd))" + local is_jarvis="$([ "$repo_name" == "jarvis" ] && echo "true" || echo "false")" + local branch="$( $is_jarvis && echo "$jv_branch" || echo "master")" printf "Checking updates for $repo_name..." read < <( git fetch origin -q & echo $! ) # suppress bash job control output jv_spinner $REPLY - case `git rev-list HEAD...origin/master --count || echo e` in + case $(git rev-list HEAD...origin/master --count || echo e) in "e") jv_error "Error";; "0") jv_success "Up-to-date";; *) jv_warning "New version available" @@ -338,7 +340,7 @@ jv_check_updates () { #git reset --hard HEAD >/dev/null # don't override local changes (config.sh) local jv_config_changed=false - if [ "$repo_name" == "jarvis" ]; then + if $is_jarvis; then # inform jarvis is updated to ask for restart jv_jarvis_updated=true elif [ 1 -eq $(git diff --name-only ..origin/master config.sh | wc -l) ]; then diff --git a/version.txt b/version.txt index 9c69642..ff388f5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -17.03.18 +17.03.19 From b377805617b2ca257a3dc7145796e8a07293fc0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20M=C3=A9ly?= Date: Sun, 19 Mar 2017 20:03:54 +0100 Subject: [PATCH 4/5] bug fix --- utils/utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/utils.sh b/utils/utils.sh index ffb1689..d4243d0 100644 --- a/utils/utils.sh +++ b/utils/utils.sh @@ -328,11 +328,11 @@ jv_check_updates () { printf "Checking updates for $repo_name..." read < <( git fetch origin -q & echo $! ) # suppress bash job control output jv_spinner $REPLY - case $(git rev-list HEAD...origin/master --count || echo e) in + case $(git rev-list HEAD...origin/$branch --count || echo e) in "e") jv_error "Error";; "0") jv_success "Up-to-date";; *) jv_warning "New version available" - changes=$(git fetch -q 2>&1 && git log HEAD..origin/master --oneline --format="- %s (%ar)" | head -5) + changes=$(git fetch -q 2>&1 && git log HEAD..origin/$branch --oneline --format="- %s (%ar)" | head -5) if $force || dialog_yesno "A new version of $repo_name is available, recent changes:\n$changes\n\nWould you like to update?" true >/dev/null; then # display recent commits in non-interactive mode $force && echo -e "Recent changes:\n$changes" From 8a0eee0c5e9a670044e1334d50d5eb78812588e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20M=C3=A9ly?= Date: Mon, 20 Mar 2017 19:34:03 +0100 Subject: [PATCH 5/5] added branch to troubleshooting config header --- jarvis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis.sh b/jarvis.sh index 797edd8..1370f6d 100755 --- a/jarvis.sh +++ b/jarvis.sh @@ -554,7 +554,7 @@ if [ "$just_execute" == false ]; then fi [ "$rec_hw" != "false" ] && microphone=$(lsusb -d $(cat /proc/asound/card${rec_hw:3:1}/usbid) | cut -c 34-) || microphone="Default" echo -e "$_gray\n------------ Config ------------" - for parameter in jv_version jv_arch jv_os_name jv_os_version language play_hw rec_hw speaker microphone recorder trigger_stt command_stt tts_engine; do + for parameter in jv_branch jv_version jv_arch jv_os_name jv_os_version language play_hw rec_hw speaker microphone recorder trigger_stt command_stt tts_engine; do printf "%-20s %s \n" "$parameter" "${!parameter}" done echo -e "--------------------------------\n$_reset"