Skip to content

Commit

Permalink
fix(ui): task terminated status on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed May 23, 2018
1 parent bf76950 commit ea95c52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ function updateViewBadges ({ task, data }, context) {
async function run (id, context) {
const task = findOne(id, context)
if (task && task.status !== 'running') {
task._terminating = false

// Answers
const answers = prompts.getAnswers()
let args = task.fullCommand ? [] : ['run', task.name]
let command = task.fullCommand ? task.command : getCommand()
Expand Down Expand Up @@ -304,7 +307,7 @@ async function run (id, context) {
})
}

if (code === null) {
if (code === null || task._terminating) {
updateOne({
id: task.id,
status: 'terminated'
Expand Down Expand Up @@ -361,6 +364,7 @@ async function run (id, context) {
function stop (id, context) {
const task = findOne(id, context)
if (task && task.status === 'running' && task.child) {
task._terminating = true
terminate(task.child.pid)
}
return task
Expand Down

0 comments on commit ea95c52

Please sign in to comment.