vagrant-phpstorm-tunnel 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/php +11 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0b73e5399f2500c7df8a3fb5d1d1f6786eaba19
|
4
|
+
data.tar.gz: d27ca5b336388c3797793a34b8cd87c18224b1d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acdcc22f26bb3e9ec49de2505c698470356aea92dfb4508e5bd4df029e533597b736f51ae51d743be1cb9acd54602489090ba444c396870507157dc2c6b6cb65
|
7
|
+
data.tar.gz: ad89ac91df40e1cb483b6e8f9108b6a1934e2f469798b96e4e01094ebd25b4f5b9544619925adb7282ceeb46f770dd1d6ecd850e7fd4a6bcd48e6a208d954885
|
data/data/php
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
#!/usr/bin/env php
|
2
2
|
<?php
|
3
3
|
|
4
|
-
$
|
5
|
-
$
|
6
|
-
$
|
7
|
-
$
|
4
|
+
$projectDirHost = dirname(dirname(dirname($_SERVER['PHP_SELF'])));
|
5
|
+
$projectDirGuest = '/vagrant';
|
6
|
+
$homeDirHost = $projectDirHost . '/.idea/vagrant';
|
7
|
+
$homeDirGuest = $projectDirGuest . '/.idea/vagrant';
|
8
8
|
$pipe = 'vagrant ssh -c ';
|
9
9
|
|
10
|
-
chdir($
|
10
|
+
chdir($projectDirHost);
|
11
11
|
|
12
12
|
// Detect Host IP
|
13
|
-
$hostIpFile = $
|
13
|
+
$hostIpFile = $homeDirHost . '/host_ip';
|
14
14
|
if (!file_exists($hostIpFile)) {
|
15
15
|
$ip = shell_exec('vagrant ssh -c "sudo ip route | awk \'/default/ { print \$3 }\'"');
|
16
16
|
file_put_contents($hostIpFile, $ip);
|
@@ -30,14 +30,14 @@ foreach ($arguments as $index => &$argument) {
|
|
30
30
|
// Paths mapping
|
31
31
|
$filePath = $argument;
|
32
32
|
if (file_exists($filePath)) {
|
33
|
-
if (strpos($filePath, $
|
33
|
+
if (strpos($filePath, $projectDirHost) !== false) {
|
34
34
|
// Mapping project paths to remote paths
|
35
|
-
$arguments[$index] = str_replace($
|
35
|
+
$arguments[$index] = str_replace($projectDirHost, $vagrantDir, $filePath);
|
36
36
|
} else {
|
37
37
|
// Mapping any other local system paths to remote paths, upload files
|
38
|
-
$
|
39
|
-
copy($filePath, $
|
40
|
-
$arguments[$index] = $
|
38
|
+
mkdir($homeDirHost . '/scripts/', 0777, true);
|
39
|
+
copy($filePath, $homeDirHost . '/scripts/' . basename($filePath));
|
40
|
+
$arguments[$index] = $homeDirGuest . '/scripts/' . basename($filePath);
|
41
41
|
}
|
42
42
|
}
|
43
43
|
|