This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service Framework Diff #1.5 - Validation Script
- Loading branch information
1 parent
a0778c3
commit fbbc130
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env node --harmony | ||
|
||
/* | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the LICENSE file in | ||
* the root directory of this source tree. | ||
*/ | ||
|
||
// Load nuclide-node-transpiler to start transpiling. | ||
require('nuclide-node-transpiler'); | ||
|
||
// Load the service parser module. | ||
var serviceParser = require('../lib/main'); | ||
|
||
// There must be exactly one argument. | ||
if (process.argv.length !== 3) { | ||
console.error('No file specified. Usage: <file>'); | ||
process.exit(1); | ||
} | ||
|
||
try { | ||
// Try to generate a proxy from the file. | ||
var file = process.argv[2]; | ||
var fakeClient = {}; | ||
var proxy = serviceParser.getProxy(require('path').resolve(file), fakeClient); | ||
} catch (e) { | ||
// Proxy generation failed. | ||
console.error('Failed to validate ' + file); | ||
console.error(e.stack); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters