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

Oni wont't open when passed a number as first parameter #2584

Open
Gahen opened this issue Sep 26, 2018 · 3 comments
Open

Oni wont't open when passed a number as first parameter #2584

Gahen opened this issue Sep 26, 2018 · 3 comments

Comments

@Gahen
Copy link

Gahen commented Sep 26, 2018

Oni Version: 0.3.6
Operating System: macOS Sierra

Issue: Running oni from the command line with a number as first parameter won't open the editor

Expected behavior: I should see the filesystem tool and the editor area

Actual behavior: I only see the system menu bar and the window UX

Steps to reproduce: open a terminal; run oni 123

Maybe this is only happening to me? I would be available to follow any debug step needed.

This is what I get:

screen shot 2018-09-26 at 11 42 05 am

@oni-bot
Copy link

oni-bot bot commented Sep 26, 2018

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

@CrossR
Copy link
Member

CrossR commented Sep 27, 2018

Hey, sorry for the slow reply!

This looks to be that the path checking logic we have fails in some fashion for just numbers:

image

I think this is type of the input being swapped to an int when just numbers are passed. Any other string seems to work (123.txt etc). The fix here should just be to force it always to a string, as well as not crashing if there is an error there.

The lines in question are these:

oni/browser/src/App.ts

Lines 110 to 112 in e3f65e6

const normalizedFiles = parsedArgs._.map(
arg => (path.isAbsolute(arg) ? arg : path.join(currentWorkingDirectory, arg)),
)

We can either swap the type just in there, or just update minimist to always treat everything as a string (except stuff like the debug flag etc).

I'll tag this as a good first issue since it seems easy enough, though we should try and get this sorted before the next release.

@Gahen
Copy link
Author

Gahen commented Sep 27, 2018

Awesome! Thanks for giving it a look.

@badosu badosu added the 0.3.8 label Sep 28, 2018
borjarus added a commit to borjarus/oni that referenced this issue Oct 25, 2018
akinsho pushed a commit that referenced this issue Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants