├── .gitignore ├── app ├── package.json ├── main.js ├── fork_compare.js └── fork_glob.js ├── readme.md ├── init.sh └── run.cmd /.gitignore: -------------------------------------------------------------------------------- 1 | build/atom-shell 2 | build/node_modules 3 | app/node_modules 4 | -------------------------------------------------------------------------------- /app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello-app", 3 | "version": "0.1.0", 4 | "main": "main.js", 5 | "dependencies": { 6 | "glob": "^4.3.2" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | **This is an example 3 | repository for atom-shell issue [#961](https://github.com/atom/atom-shell/issues/961)** 4 | 5 | 6 | To run you should be able to do the following: 7 | 8 | `./init.sh` on mac 9 | 10 | or on windows `init` 11 | -------------------------------------------------------------------------------- /app/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var app = require('app'); 4 | var path = require('path'); 5 | var forkFile; 6 | 7 | app.on('ready', function() { 8 | 9 | forkFile = 'fork_compare.js'; 10 | // forkFile = 'fork_glob.js'; 11 | 12 | require('child_process').fork(path.join(__dirname, forkFile)); 13 | }); 14 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -e 3 | 4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | 6 | pushd "${DIR}/build" 7 | npm install -g grunt-cli 8 | npm install 9 | grunt download-atom-shell 10 | popd 11 | 12 | pushd "${DIR}/app" 13 | npm install 14 | popd 15 | 16 | "${DIR}/build/atom-shell/Atom.app/Contents/MacOS/Atom" "${DIR}/app" 17 | -------------------------------------------------------------------------------- /run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Windows version of the run script. 3 | 4 | setlocal 5 | set SCRIPT_DIR=%~dp0 6 | 7 | pushd "%SCRIPT_DIR%\build" 8 | call npm install -g grunt-cli 9 | call npm install 10 | call grunt download-atom-shell 11 | popd 12 | 13 | pushd "%SCRIPT_DIR%\app" 14 | call npm install 15 | popd 16 | 17 | "%SCRIPT_DIR%\build\atom-shell\atom" "%SCRIPT_DIR%\hello-app" 18 | -------------------------------------------------------------------------------- /app/fork_compare.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | console.log('------ Test localeCompare #1 ------'); 4 | // The following messages are not printed in the console 5 | console.log('a'.localeCompare('c')); // -2, or -1, or some other negative value 6 | 7 | console.log('------ Test localeCompare #2 ------'); 8 | console.log('c'.localeCompare('a')); // 2, or 1, or some other positive value 9 | 10 | console.log('------ Test localeCompare #3 ------'); 11 | console.log('a'.localeCompare('a')); // 0 12 | -------------------------------------------------------------------------------- /app/fork_glob.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | var glob = require('glob'); 5 | var globPath; 6 | 7 | console.log('------ Test glob #1 ------'); 8 | globPath = __dirname; 9 | console.log('Running glob with arg', globPath); 10 | console.log((glob.sync(globPath).length === 1) ? 'Passed' : 'Failed'); 11 | 12 | console.log('------ Test glob #2 ------'); 13 | globPath = path.join(__dirname, '*'); 14 | console.log('Running glob with arg', globPath); 15 | console.log((glob.sync(globPath).length > 1) ? 'Passed' : 'Failed'); 16 | --------------------------------------------------------------------------------