Skip to content

Commit

Permalink
refactor(lib): coffe script support (#3188)
Browse files Browse the repository at this point in the history
  • Loading branch information
lusarz authored and johnjbarton committed Oct 17, 2018
1 parent 1458267 commit 8542f27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions lib/config.js
Expand Up @@ -13,14 +13,6 @@ let COFFEE_SCRIPT_AVAILABLE = false
let LIVE_SCRIPT_AVAILABLE = false
let TYPE_SCRIPT_AVAILABLE = false

// Coffee is required here to enable config files written in coffee-script.
// It's not directly used in this file.
try {
require('coffee-script').register()
COFFEE_SCRIPT_AVAILABLE = true
} catch (e) {}

// CoffeeScript lost the hyphen in the module name a long time ago, all new version are named this:
try {
require('coffeescript').register()
COFFEE_SCRIPT_AVAILABLE = true
Expand Down Expand Up @@ -367,7 +359,7 @@ function parseConfig (configFilePath, cliOptions) {

const extension = path.extname(configFilePath)
if (extension === '.coffee' && !COFFEE_SCRIPT_AVAILABLE) {
log.error('You need to install CoffeeScript.\n npm install coffee-script --save-dev')
log.error('You need to install CoffeeScript.\n npm install coffeescript --save-dev')
} else if (extension === '.ls' && !LIVE_SCRIPT_AVAILABLE) {
log.error('You need to install LiveScript.\n npm install LiveScript --save-dev')
} else if (extension === '.ts' && !TYPE_SCRIPT_AVAILABLE) {
Expand Down
2 changes: 1 addition & 1 deletion lib/init.js
Expand Up @@ -225,7 +225,7 @@ exports.init = function (config) {
const testMainFilePath = path.resolve(cwd, testMainFile)

if (isCoffee) {
installPackage('coffee-script')
installPackage('coffeescript')
}

if (processedAnswers.generateTestMain) {
Expand Down

0 comments on commit 8542f27

Please sign in to comment.