- Improving the shell. Still not a real shell.

This commit is contained in:
Gunther Brunner
2014-04-01 22:04:36 +09:00
parent e17f306d30
commit af47e535e4
10 changed files with 95 additions and 13 deletions

View File

@@ -1,16 +1,34 @@
module.exports = function ShellCtrl($scope, $rootScope) {
$scope.results = []
// TODO: implement multiple devices
// $scope.results = []
$scope.result = null
$scope.referenceUrl = 'https://github.com/jackpal/Android-Terminal-Emulator/wiki/Android-Shell-Command-Reference'
$scope.run = function(command) {
if (command === 'clear') {
$scope.clear()
return
}
var cmd = $rootScope.control.shell(command)
$scope.command = ''
return cmd.promise
.progressed(function(results) {
$scope.results = results
.progressed(function(result) {
//$scope.result = result
$scope.data = result.data.join('')
$scope.$digest()
})
.then(function(results) {
$scope.results = results
.then(function(result) {
$scope.data = result.data.join('')
// $scope.result = result
$scope.$digest()
})
}
$scope.clear = function () {
$scope.command = ''
$scope.data = ''
}
}