Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #186 from AllanYangZhou/develop
Browse files Browse the repository at this point in the history
Last minute fixes + release script
  • Loading branch information
Allan Zhou committed Feb 27, 2016
2 parents f732301 + 8ad2844 commit e347851
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 4 deletions.
Binary file added dawn/icons/pieicon.icns
Binary file not shown.
Binary file added dawn/icons/pieicon.ico
Binary file not shown.
12 changes: 10 additions & 2 deletions dawn/js/actions/EditorActionCreators.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ let EditorActionCreators = {
};

if (filepath === null) {
dialog.showSaveDialog(function(filepath) {
dialog.showSaveDialog({
filters: [{ name: 'python', extensions: ['py']}]
}, function(filepath) {
if (filepath === undefined) return;
writeContents(filepath);

// Automatically append .py extension if they don't have it
if (filepath.endsWith('.py')) {
writeContents(filepath);
} else {
writeContents(filepath + '.py');
}
});
} else {
writeContents(filepath);
Expand Down
7 changes: 6 additions & 1 deletion dawn/js/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ export default React.createClass({
},
pathToName(filepath) {
if (filepath !== null) {
return filepath.split('/').pop();
if (process.platform === 'win32') {
return filepath.split('\\').pop();
} else {
return filepath.split('/').pop();
}
} else {
return '[ New File ]';
}
Expand Down Expand Up @@ -218,6 +222,7 @@ export default React.createClass({
mode="python"
theme={ this.state.editorTheme }
width="100%"
fontSize={14}
ref="CodeEditor"
name="CodeEditor"
height={String(
Expand Down
3 changes: 2 additions & 1 deletion dawn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dawn",
"version": "0.4.0-beta.3",
"version": "0.4.0",
"description": "Frontend for PIE Robotics System",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -28,6 +28,7 @@
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"better-npm-run": "0.0.7",
"minimist": "^1.2.0",
"webpack": "^1.12.13"
},
"dependencies": {
Expand Down
56 changes: 56 additions & 0 deletions dawn/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
var minimist = require('minimist');
var packager = require('electron-packager');
var execSync = require('child_process').execSync;

function build() {
console.log('Packaging with webpack, using the production config');
var child = execSync('npm run-script build', function(err, stdout, stderr) {
console.log('stderr: ', stderr);
if (err !== null) {
console.log('error: ', err);
}
});
}

function pack(prod, platform, arch) {
var opts = {}; //packaging options

if (prod) {
console.log('Packaging for all platforms');
opts.all = true; // build for all platforms and arch
} else {
console.log('Packaging for: ', platform, arch);
opts.platform = platform;
opts.arch = arch;
}

opts.dir = __dirname; // source dir
opts.name = 'dawn';
opts.prune = true; //remove dev dependencies
opts.icon = './icons/icon';
opts.version = '0.36.2';
opts.out = '../..'

packager(opts, function(err, appPath) {
if (err) {
console.log('Packaging error: ', err);
} else {
console.log(appPath);
}
});
}

// General release command: 'node release.js --prod'.
// If you already ran build: 'node release.js --prod --prebuilt'
// For a specific target: 'node release.js --platform=... --arch=...'
function main() {
var argv = minimist(process.argv.slice(2));

if (!argv.prebuilt) {
build();
}

pack(argv.prod, argv.platform, argv.arch);
}

main();

0 comments on commit e347851

Please sign in to comment.