Skip to content

Commit

Permalink
Add copy ramda.js script
Browse files Browse the repository at this point in the history
  • Loading branch information
MattMS committed Jul 3, 2016
1 parent 901b634 commit a18918c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions copy_ramda_js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var fs = require('fs')

var get_ramda_file = require('./get_ramda_file')

var path = require('path')

get_ramda_file(path.join('dist', 'ramda.js'))
.catch((err) => console.error(err))
.then((ramda_js) => {
fs.writeFileSync(path.join('docs', 'dist', 'ramda.js'), ramda_js, {encoding: 'utf8'})
})
18 changes: 18 additions & 0 deletions get_ramda_file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var fs = require('fs')

var path = require('path')

module.exports = (child_path) => new Promise ((resolve, reject) => {
var ramda_module_path = require.resolve('ramda')

var ramda_folder = path.normalize(path.join(ramda_module_path, '..', '..'))

var file_path = path.join(ramda_folder, child_path)

fs.readFile(file_path, 'utf8', (err, data) => {
if (err)
reject(err)
else
resolve(data)
})
})

0 comments on commit a18918c

Please sign in to comment.