-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix version catcher to not snag java * fix stderror on windows * clean up unused * fixup tests * add tests * add tests
- Loading branch information
Showing
7 changed files
with
52 additions
and
5 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,13 @@ | ||
const checkSTDERR = require('../../src/extensions/functions/checkSTDERR') | ||
const context = require('mockContext') | ||
|
||
describe('checkSTDERR', () => { | ||
test('returns augmented string', async () => { | ||
const rule = { rule: 'cli', binary: 'yarn', version: '--version' } | ||
const normal = `${rule.binary} ${rule.version}` | ||
const output = await checkSTDERR(rule, context) | ||
|
||
expect(typeof output).toBe('string') | ||
expect(output.length).toBeGreaterThan(normal.length) | ||
}) | ||
} |
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
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
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,15 @@ | ||
import { CLIRule } from '../../types' | ||
|
||
// Creates STDERR catching string | ||
module.exports = (rule: CLIRule): string => { | ||
const currentPlatform = process.platform | ||
let grabErrorOutput: string | ||
if (currentPlatform === 'win32') { | ||
const tempFile = `solidarityWinFix${rule.binary}.tmp` | ||
grabErrorOutput = `1>${tempFile} 2>&1 & type ${tempFile} & del ${tempFile}` | ||
} else { | ||
grabErrorOutput = '2>&1 | cat' | ||
} | ||
|
||
return `${rule.binary} ${rule.version} ${grabErrorOutput}` | ||
} |
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
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
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