vagrant-phpstorm-tunnel 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/data/php +11 -11
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d9482a0100d5aa82f72d85ec121f834ed681449
4
- data.tar.gz: 7c8e625a46c9cb041b948534125b82be649331be
3
+ metadata.gz: d0b73e5399f2500c7df8a3fb5d1d1f6786eaba19
4
+ data.tar.gz: d27ca5b336388c3797793a34b8cd87c18224b1d9
5
5
  SHA512:
6
- metadata.gz: c188fb3c973efa43ee60f97d275f47383709333524e375b7b85fc7fd16b766bc6f54c04894b0ecac468207925ef46c13d9fdb37dcacd3575356ddff3d1289ecf
7
- data.tar.gz: 46fb36af966247aad6d27a54696a8bf9804d2817dadabac9786ec3a98e6aa6e3b8b425c47efcc1a61f6c768f65ff1d44d31ad50fc2730fb9c53d9b8fa8d6530c
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
- $projectDir = dirname(dirname(dirname($_SERVER['PHP_SELF'])));
5
- $homeDir = $projectDir . '/.idea/vagrant';
6
- $tmpDir = $homeDir . '/tmp';
7
- $vagrantDir = '/vagrant';
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($projectDir);
10
+ chdir($projectDirHost);
11
11
 
12
12
  // Detect Host IP
13
- $hostIpFile = $homeDir . '/host_ip';
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, $projectDir) !== false) {
33
+ if (strpos($filePath, $projectDirHost) !== false) {
34
34
  // Mapping project paths to remote paths
35
- $arguments[$index] = str_replace($projectDir, $vagrantDir, $filePath);
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
- $basename = basename($filePath);
39
- copy($filePath, $projectDir . '/' . $tmpDir . '/tunnel.' . $basename);
40
- $arguments[$index] = $vagrantDir . '/' . $tmpDir . '/tunnel.' . $basename;
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-phpstorm-tunnel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media