You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2014/07/09 00:50:01 UTC

[2/6] git commit: support direct run of .ps1 file w/out batch file patch by Josh McKenzie; reviewed by Ala' Alkhaldi for CASSANDRA-7517

support direct run of .ps1 file w/out batch file
patch by Josh McKenzie; reviewed by Ala' Alkhaldi for CASSANDRA-7517


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/895eaecc
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/895eaecc
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/895eaecc

Branch: refs/heads/cassandra-2.1.0
Commit: 895eaecc3d6d3481db8f2c4db341ec2280344c00
Parents: c29e48d
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 8 17:51:12 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 8 17:51:12 2014 -0500

----------------------------------------------------------------------
 bin/cassandra.ps1 | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/895eaecc/bin/cassandra.ps1
----------------------------------------------------------------------
diff --git a/bin/cassandra.ps1 b/bin/cassandra.ps1
index 5225e32..237c28c 100644
--- a/bin/cassandra.ps1
+++ b/bin/cassandra.ps1
@@ -66,7 +66,14 @@ Function Main
 {
     ValidateArguments
 
+    # support direct run of .ps1 file w/out batch file
+    if ($env:CASSANDRA_HOME -eq $null)
+    {
+        $scriptDir = Split-Path $script:MyInvocation.MyCommand.Path
+        $env:CASSANDRA_HOME = (Get-Item $scriptDir).parent.FullName
+    }
     . "$env:CASSANDRA_HOME\bin\source-conf.ps1"
+
     $conf = Find-Conf
     if ($verbose)
     {