[Launcher] fzf, cmd processing, args
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
import subprocessRunner from "./subprocessRunner";
|
||||
import fzf from "./fzf";
|
||||
|
||||
const preprocess = ( input: string ) => {
|
||||
// Find out what kind of instruction to process
|
||||
@@ -19,8 +20,11 @@ const preprocess = ( input: string ) => {
|
||||
// Determine if entered string is calculation or not
|
||||
// We can easily do that by asking qalc (qalculate cli) if this is fine
|
||||
subprocessRunner.executeCommand( 'qalc "' + input + '"' ).then( out => {
|
||||
// we get a calculation result here
|
||||
print( out );
|
||||
processCalculation( out );
|
||||
} ).catch( err => {
|
||||
processSearch( input );
|
||||
print( err );
|
||||
} );
|
||||
}
|
||||
@@ -30,7 +34,7 @@ const processSearch = ( input: string ) => {
|
||||
|
||||
}
|
||||
|
||||
const processCalculation = ( input: string ) => {
|
||||
const processCalculation = ( output: string ) => {
|
||||
|
||||
}
|
||||
|
||||
@@ -41,3 +45,7 @@ const processCommand = ( cmd: string, args: string[] ) => {
|
||||
const processBang = ( bang: string, input: string ) => {
|
||||
|
||||
}
|
||||
|
||||
export default {
|
||||
preprocess
|
||||
}
|
||||
|
Reference in New Issue
Block a user