cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [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
Date Tue, 08 Jul 2014 22:50:01 GMT
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 <jbellis@apache.org>
Authored: Tue Jul 8 17:51:12 2014 -0500
Committer: Jonathan Ellis <jbellis@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)
     {


Mime
View raw message