Skip to content

Commit

Permalink
FORGE-1391: cd ~~ is now working
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jan 21, 2014
1 parent fd87aca commit 1bb1f55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Result execute(UIExecutionContext context) throws Exception
{
String newPath = it.next();
final List<Resource<?>> newResource;
if ("~".equals(newPath) && project != null)
if ("~~".equals(newPath) && project != null)
{
newResource = Arrays.<Resource<?>> asList(project.getProjectRoot());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public List<Resource<?>> resolve()
}
else if (path.startsWith("~"))
{
File homeDir = new File(System.getProperty("user.home")).getAbsoluteFile();
File homeDir = OperatingSystemUtils.getUserHomeDir();

if (path.length() == 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testCDProject() throws Exception

shellTest.execute("mkdir abc", 5, TimeUnit.SECONDS);
shellTest.execute("cd abc", 5, TimeUnit.SECONDS);
shellTest.execute("cd ~", 5, TimeUnit.SECONDS);
shellTest.execute("cd ~~", 5, TimeUnit.SECONDS);
shellTest.clearScreen();
shellTest.execute("pwd", 5, TimeUnit.SECONDS);
Assert.assertThat(shellTest.getStdOut(), CoreMatchers.containsString(projectPath));
Expand Down

0 comments on commit 1bb1f55

Please sign in to comment.