Write control/desktop files to temp folder
Esse commit está contido em:
@@ -13,5 +13,3 @@ debug.log
|
|||||||
docs/output
|
docs/output
|
||||||
docs/includes
|
docs/includes
|
||||||
spec/fixtures/evil-files/
|
spec/fixtures/evil-files/
|
||||||
resources/linux/Atom.desktop
|
|
||||||
resources/linux/debian/control
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
"grunt-cli": "~0.1.9",
|
"grunt-cli": "~0.1.9",
|
||||||
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git",
|
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git",
|
||||||
"grunt-contrib-csslint": "~0.1.2",
|
|
||||||
"grunt-contrib-coffee": "~0.9.0",
|
"grunt-contrib-coffee": "~0.9.0",
|
||||||
|
"grunt-contrib-csslint": "~0.1.2",
|
||||||
"grunt-contrib-less": "~0.8.0",
|
"grunt-contrib-less": "~0.8.0",
|
||||||
"grunt-cson": "0.8.0",
|
"grunt-cson": "0.8.0",
|
||||||
"grunt-download-atom-shell": "~0.8.0",
|
"grunt-download-atom-shell": "~0.8.0",
|
||||||
@@ -27,15 +27,16 @@
|
|||||||
"json-front-matter": "~0.1.3",
|
"json-front-matter": "~0.1.3",
|
||||||
"legal-eagle": "~0.4.0",
|
"legal-eagle": "~0.4.0",
|
||||||
"minidump": "~0.7",
|
"minidump": "~0.7",
|
||||||
"read-package-json": "1.1.8",
|
|
||||||
"normalize-package-data": "0.2.12",
|
"normalize-package-data": "0.2.12",
|
||||||
|
"npm": "~1.4.5",
|
||||||
"rcedit": "~0.1.2",
|
"rcedit": "~0.1.2",
|
||||||
|
"read-package-json": "1.1.8",
|
||||||
"request": "~2.27.0",
|
"request": "~2.27.0",
|
||||||
"rimraf": "~2.2.2",
|
"rimraf": "~2.2.2",
|
||||||
"runas": "0.5.x",
|
"runas": "0.5.x",
|
||||||
|
"temp": "^0.8.0",
|
||||||
"underscore-plus": "1.x",
|
"underscore-plus": "1.x",
|
||||||
"unzip": "~0.1.9",
|
"unzip": "~0.1.9",
|
||||||
"vm-compatibility-layer": "~0.1.0",
|
"vm-compatibility-layer": "~0.1.0"
|
||||||
"npm": "~1.4.5"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
fs = require 'fs'
|
fs = require 'fs'
|
||||||
path = require 'path'
|
path = require 'path'
|
||||||
_ = require 'underscore-plus'
|
_ = require 'underscore-plus'
|
||||||
|
temp = require 'temp'
|
||||||
|
|
||||||
|
tempResourcesFolder = temp.mkdirSync('atom-resources-')
|
||||||
|
|
||||||
fillTemplate = (filePath, data) ->
|
fillTemplate = (filePath, data) ->
|
||||||
template = _.template(String(fs.readFileSync(filePath + '.in')))
|
template = _.template(String(fs.readFileSync("#{filePath}.in")))
|
||||||
filled = template(data)
|
filled = template(data)
|
||||||
fs.writeFileSync(filePath, filled)
|
|
||||||
|
outputPath = path.join(tempResourcesFolder, path.basename(filePath))
|
||||||
|
fs.writeFileSync(outputPath, filled)
|
||||||
|
outputPath
|
||||||
|
|
||||||
module.exports = (grunt) ->
|
module.exports = (grunt) ->
|
||||||
{spawn} = require('./task-helpers')(grunt)
|
{spawn} = require('./task-helpers')(grunt)
|
||||||
@@ -27,13 +33,11 @@ module.exports = (grunt) ->
|
|||||||
iconName = 'atom'
|
iconName = 'atom'
|
||||||
data = {name, version, description, section, arch, maintainer, installDir, iconName}
|
data = {name, version, description, section, arch, maintainer, installDir, iconName}
|
||||||
|
|
||||||
control = path.join('resources', 'linux', 'debian', 'control')
|
controlFilePath = fillTemplate(path.join('resources', 'linux', 'debian', 'control'), data)
|
||||||
fillTemplate(control, data)
|
desktopFilePath = fillTemplate(path.join('resources', 'linux', 'Atom.desktop'), data)
|
||||||
desktop = path.join('resources', 'linux', 'Atom.desktop')
|
|
||||||
fillTemplate(desktop, data)
|
|
||||||
icon = path.join('resources', 'atom.png')
|
icon = path.join('resources', 'atom.png')
|
||||||
buildDir = grunt.config.get('atom.buildDir')
|
buildDir = grunt.config.get('atom.buildDir')
|
||||||
|
|
||||||
cmd = path.join('script', 'mkdeb')
|
cmd = path.join('script', 'mkdeb')
|
||||||
args = [version, arch, control, desktop, icon, buildDir]
|
args = [version, arch, controlFilePath, desktopFilePath, icon, buildDir]
|
||||||
spawn({cmd, args}, done)
|
spawn({cmd, args}, done)
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário