Dart pub工具的返回码是什么? [英] What are the return codes for the Dart pub tool

查看:295
本文介绍了Dart pub工具的返回码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将在批处理文件中迭代地启动pub get和pub build,我需要测试错误的返回码。返回代码似乎没有记录在Dart文档中。

I'm going to be launching "pub get" and "pub build" iteratively in a batch file, and I need to test the return codes for errors. The return codes don't seem to be documented in the Dart docs. Does anyone know what they are, or where they're documented?

推荐答案

我发现这些:

  • search in pub.dart for 'exit_codes' to see which constants are used
  • the constant values are defined here: (copied from exit_codes.dart)
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// Exit code constants. From [the BSD sysexits manpage][manpage]. Not every
/// constant here is used, even though some of the unused ones may be
/// appropriate for errors encountered by pub.
///
/// [manpage]: http://www.freebsd.org/cgi/man.cgi?query=sysexits
library pub.exit_codes;

/// The command completely successfully.
const SUCCESS = 0;

/// The command was used incorrectly.
const USAGE = 64;

/// The input data was incorrect.
const DATA = 65;

/// An input file did not exist or was unreadable.
const NO_INPUT = 66;

/// The user specified did not exist.
const NO_USER = 67;

/// The host specified did not exist.
const NO_HOST = 68;

/// A service is unavailable.
const UNAVAILABLE = 69;

/// An internal software error has been detected.
const SOFTWARE = 70;

/// An operating system error has been detected.
const OS = 71;

/// Some system file did not exist or was unreadable.
const OS_FILE = 72;

/// A user-specified output file cannot be created.
const CANT_CREATE = 73;

/// An error occurred while doing I/O on some file.
const IO = 74;

/// Temporary failure, indicating something that is not really an error.
const TEMP_FAIL = 75;

/// The remote system returned something invalid during a protocol exchange.
const PROTOCOL = 76;

/// The user did not have sufficient permissions.
const NO_PERM = 77;

/// Something was unconfigured or mis-configured.
const CONFIG = 78;

这篇关于Dart pub工具的返回码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆