BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

Add a directory argument for the REPL

Description

I would like to set a working directory path in the REPL to be able to instantiate objects from within the REPL, so I need to be able to set the home directory of the REPL. Doing this:

CFSCRIPT-REPL: expandpath( "./");
=> "/Users/rmunn/.CommandBox/cfml/system/"

shows where the REPL is running from, and you can instantiate objects:

CFSCRIPT-REPL: uri = createObject( "java", "java.net.URI");
CFSCRIPT-REPL: writeDump( uri );

A directory argument would allow you to instantiate objects from any project, and that would be great.

Gliffy Diagrams

Activity

Show:

Brad Wood October 13, 2015 at 5:57 AM
Edited

Note,

expandpath( "" )

will always point to the folder where the CommandBox bootstrap.cfm file since the path that "" resolves to can't be changed during a request. However, CFC instantiation is now rooted in the current working directory. Also, functions like

getDirectoryFromPath( getCurrenttemplatePath() )

from the repl will return the CWD, or at least the directory that the REPL was started from.

Eric Peterson October 5, 2015 at 9:31 PM
Edited

I submitted a pull request for this issue here: https://github.com/Ortus-Solutions/commandbox/pull/50

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Assignee

Brad Wood

Reporter

Affects versions

Fix versions

Priority

Components

Created March 14, 2015 at 10:09 PM
Updated November 12, 2015 at 4:26 AM
Resolved October 13, 2015 at 6:01 AM

Flag notifications