Starting atom via command line does not launch it correctly


#1

I recently wanted to make my own portable atom, so I made this script to set ATOM_HOME and run atom:

@echo off
set ATOM_HOME= "E:/.atom"
start E:/Atom/atom.exe
echo ATOM_HOME currently at %ATOM_HOME%
echo.
pause

When I run this everything looks fine until atom starts up. At that point it loads with devtools open and a single menu item – atom

in the command line, I see the following error:

ATOM_HOME currently at  "E:/.atom"

Press any key to continue . . . App load time: 593ms
[4452:0421/080335:INFO:renderer_main.cc(212)] Renderer process started

[4924:0421/080402:INFO:CONSOLE(67)] "RangeError: Maximum call stack size exceede
d
    at new Error (native)
    at Error (native)
    at Object.fs.mkdirSync (fs.js:791:18)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:55:12)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:61:24)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:62:17)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:62:17)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:62:17)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:62:17)
    at sync (E:\Atom\resources\app\node_modules\fs-plus\node_modules\mkdirp\inde
x.js:62:17)", source: file:///E:/Atom/resources/app/static/index.js (67)
[3564:0421/080402:INFO:renderer_main.cc(212)] Renderer process started

What is the issue here? How can I fix it?


#2

It’s not that easy to make it portable, I’m afraid.

What you’re seeing is Atom unable to be launched by atom shell / electron, if I interpret this correctly?
Did you just copy your .atom folder into the atom binary folder then?

What does the dev tools console tell you?


#3

I created a .atom folder on my flash drive, then extracted the zip distribution of atom into an Atom folder, and then tried to run the script. The dev tools are telling me no more than the console. The flash drive is only 1g, but I still have over half of it available, could this be the problem?


#4

Filed new bug at: https://github.com/atom/atom/issues/6452