Speak sayto bash pipes (#2111)
- Change mycroft-speak & mycroft-say-to to accept bash pipes - add feature to allow all args to read into messagepull/2115/head
							parent
							
								
									b95c8c990b
								
							
						
					
					
						commit
						f90e3fbfc7
					
				| 
						 | 
					@ -21,5 +21,9 @@ DIR="$( pwd )"
 | 
				
			||||||
# Enter the Mycroft venv
 | 
					# Enter the Mycroft venv
 | 
				
			||||||
source "$DIR/../venv-activate.sh" -q
 | 
					source "$DIR/../venv-activate.sh" -q
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Sets var 1 to stdin if no args were given
 | 
				
			||||||
 | 
					set -- "${1:-$(</dev/stdin)}" "${@:2}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Send a message to be spoken
 | 
					# Send a message to be spoken
 | 
				
			||||||
output=$(python -m mycroft.messagebus.send "recognizer_loop:utterance"  "{\"utterances\": [\"$@\"], \"lang\": \"en-us\"}")
 | 
					data="$@"
 | 
				
			||||||
 | 
					output=$(python -m mycroft.messagebus.send "recognizer_loop:utterance"  "{\"utterances\": [\"$data\"], \"lang\": \"en-us\"}")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,13 +13,15 @@
 | 
				
			||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
# See the License for the specific language governing permissions and
 | 
					# See the License for the specific language governing permissions and
 | 
				
			||||||
# limitations under the License.
 | 
					# limitations under the License.
 | 
				
			||||||
 | 
					 | 
				
			||||||
SOURCE="${BASH_SOURCE[0]}"
 | 
					SOURCE="${BASH_SOURCE[0]}"
 | 
				
			||||||
cd -P "$( dirname "$SOURCE" )"
 | 
					cd -P "$( dirname "$SOURCE" )"
 | 
				
			||||||
DIR="$( pwd )"
 | 
					DIR="$( pwd )"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Sets var 1 to stdin if no args were given
 | 
				
			||||||
 | 
					set -- "${1:-$(</dev/stdin)}" "${@:2}"
 | 
				
			||||||
# Enter the Mycroft venv
 | 
					# Enter the Mycroft venv
 | 
				
			||||||
source "$DIR/../venv-activate.sh" -q
 | 
					source "$DIR/../venv-activate.sh" -q
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Send a message to be spoken
 | 
					# Send a message to be spoken
 | 
				
			||||||
output=$(python -m mycroft.messagebus.send "speak"  "{\"utterance\": \"$@\"}")
 | 
					data="$@"
 | 
				
			||||||
 | 
					output=$(python -m mycroft.messagebus.send "speak"  "{\"utterance\": \"$data\"}")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue