Closed Bug 771466 Opened 13 years ago Closed 13 years ago

GCLI devtools.command.dir option should accept ~ for home directory

Categories

(DevTools Graveyard :: Graphic Commandline and Toolbar, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: jwalker, Assigned: ravicat2013)

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Triage: Filter on the TRIAGE keyword.
Target Milestone: Firefox 17 → Future
Priority: P2 → P3
Whiteboard: [good first bug][mentor=jwalker]
like to work on this bug....
can u suggest me where to start ??
The code that processes the command dir is in browser/devtools/commandline/CmdCmd.jsm see refreshAutoCommands(). We need to check for an initial ~/ and replace with the users home directory, which we can probably get as using the docs here: https://developer.mozilla.org/en-US/docs/Code_snippets/File_I_O#Getting_special_files Hope that helps.
Assignee: nobody → ravicat2013
Status: NEW → ASSIGNED
now it works as expected
Attachment #656520 - Flags: review?(jwalker)
Comment on attachment 656520 [details] [diff] [review] it resolves ~/file /home/path/file and simillarly in windows Review of attachment 656520 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/commandline/CmdCmd.jsm @@ +67,5 @@ > + let homeDirFile = dirService.get("Home", Ci.nsIFile); // returns an nsIFile object > + let homeDir = homeDirFile.path; > + dirName = dirName.substr(2); > + dirName = homeDir + "\\" + dirName; > + } Thanks for this. I think there is some tidying up that we can do. We generally use 2 space tabs in mozilla, and we remove spaces at the end of lines. Also the first 4 lines of these if statements are the same. How about checking for an initial '~', then calculating the homeDir and removing the first character of the dirName before prefixing with the homeDir?
ya you are right .... i will make the changes.....
Attached patch made the required changes (obsolete) — Splinter Review
Attachment #656520 - Attachment is obsolete: true
Attachment #656520 - Flags: review?(jwalker)
Attachment #656589 - Flags: review?(jwalker)
Comment on attachment 656589 [details] [diff] [review] made the required changes Review of attachment 656589 [details] [diff] [review]: ----------------------------------------------------------------- There are still a few spaces out, but I can tweak that as I land. Thanks.
Attachment #656589 - Flags: review?(jwalker) → review+
Found this during a bug search, appears to be a reviewed patch that needs landing.
Thanks Rob. Added to my landing list.
New component triage. Filter on "Lobster Thermidor aux crevettes with a Mornay sauce"
Component: Developer Tools: Console → Developer Tools: Graphic Commandline and Toolbar
Attached patch v2Splinter Review
Attachment #656589 - Attachment is obsolete: true
And sorry for the delay in getting this landed!
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: