@@ -66,6 +66,8 @@ class LishCommand extends PubCommand {
66
66
/// Whether the publish requires confirmation.
67
67
bool get force => argResults['force' ];
68
68
69
+ bool get skipValidation => argResults['skip-validation' ];
70
+
69
71
LishCommand () {
70
72
argParser.addFlag (
71
73
'dry-run' ,
@@ -79,6 +81,12 @@ class LishCommand extends PubCommand {
79
81
negatable: false ,
80
82
help: 'Publish without confirmation if there are no errors.' ,
81
83
);
84
+ argParser.addFlag (
85
+ 'skip-validation' ,
86
+ negatable: false ,
87
+ help:
88
+ 'Publish without validation and resolution (this will ignore errors).' ,
89
+ );
82
90
argParser.addOption (
83
91
'server' ,
84
92
help: 'The package server to which to upload this package.' ,
@@ -251,7 +259,13 @@ the \$PUB_HOSTED_URL environment variable.''',
251
259
'pubspec.' );
252
260
}
253
261
254
- await entrypoint.acquireDependencies (SolveType .get , analytics: analytics);
262
+ if (! skipValidation) {
263
+ await entrypoint.acquireDependencies (SolveType .get , analytics: analytics);
264
+ } else {
265
+ log.warning (
266
+ 'Running with `skip-validation`. No client-side validation is done.' ,
267
+ );
268
+ }
255
269
256
270
var files = entrypoint.root.listFiles ();
257
271
log.fine ('Archiving and publishing ${entrypoint .root .name }.' );
@@ -267,10 +281,12 @@ the \$PUB_HOSTED_URL environment variable.''',
267
281
createTarGz (files, baseDir: entrypoint.rootDir).toBytes ();
268
282
269
283
// Validate the package.
270
- var isValid = await _validate (
271
- packageBytesFuture.then ((bytes) => bytes.length),
272
- files,
273
- );
284
+ var isValid = skipValidation
285
+ ? true
286
+ : await _validate (
287
+ packageBytesFuture.then ((bytes) => bytes.length),
288
+ files,
289
+ );
274
290
if (! isValid) {
275
291
overrideExitCode (exit_codes.DATA );
276
292
return ;
0 commit comments