mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
39 lines
1.3 KiB
CoffeeScript
39 lines
1.3 KiB
CoffeeScript
fs = require 'fs-plus'
|
|
path = require 'path'
|
|
|
|
module.exports = (grunt) ->
|
|
{cp, mkdir, rm} = require('./task-helpers')(grunt)
|
|
rootDir = path.resolve(path.join('../', 'src', 'pro'))
|
|
|
|
copyArcFiles = ->
|
|
cp path.join(rootDir, 'arc-N1', '.arcconfig'), '.arcconfig'
|
|
cp path.join(rootDir, 'arc-N1', '.arclint'), '.arclint'
|
|
cp path.join(rootDir, 'arc-N1', 'arclib'), 'arclib'
|
|
|
|
copySourceExtensions = ->
|
|
cp path.join(rootDir, 'src'), 'src'
|
|
|
|
linkPlugins = ->
|
|
for plugin in fs.readdirSync(path.join(rootDir, 'packages'))
|
|
from = path.join(rootDir, 'packages', plugin)
|
|
to = path.join(path.resolve('internal_packages'), plugin)
|
|
|
|
try
|
|
if fs.lstatSync(to)
|
|
grunt.log.writeln "Removing old symlink at #{to}"
|
|
fs.unlinkSync(to)
|
|
|
|
grunt.log.writeln "Adding '#{plugin}' to internal_packages"
|
|
fs.symlinkSync(from, to, 'dir')
|
|
|
|
desc = 'Adds in proprietary Nylas packages, fonts, and sounds to N1'
|
|
grunt.registerTask 'add-nylas-build-resources', desc, ->
|
|
canaryFileExists = fs.existsSync(path.join(rootDir, "README.md"))
|
|
if not canaryFileExists
|
|
grunt.log.writeln "No extra Nylas resources added"
|
|
return
|
|
else
|
|
grunt.log.writeln "Found proprietary Nylas plugins"
|
|
copyArcFiles()
|
|
copySourceExtensions()
|
|
linkPlugins()
|