Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(generic): move ora.ora to an ora helper for ease of submodul…
…e use ISSUES CLOSED: #100
- Loading branch information
1 parent
559956b
commit ee33638
Showing
6 changed files
with
40 additions
and
42 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
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,32 @@ | ||
import debug from 'debug'; | ||
import realOra from 'ora'; | ||
|
||
const d = debug('electron-forge:lifecycle'); | ||
|
||
const useFakeOra = (process.env.DEBUG && process.env.DEBUG.includes('electron-forge')); | ||
|
||
if (useFakeOra) { | ||
console.warn('WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle'.red); | ||
} | ||
|
||
export default useFakeOra ? (name) => { | ||
const fake = { | ||
start: () => { | ||
d('Process Started:', name); | ||
return fake; | ||
}, | ||
fail: () => { | ||
d(`Process Failed: ${name}`.red); | ||
return fake; | ||
}, | ||
succeed: () => { | ||
d('Process Succeeded:', name); | ||
return fake; | ||
}, | ||
stop: () => { | ||
d('Process Stopped:', name); | ||
return fake; | ||
}, | ||
}; | ||
return fake; | ||
} : realOra; |
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