-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 2 rewrite: Valet 4 compat, add install script
- Loading branch information
Showing
4 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/local/bin/php | ||
<?php | ||
|
||
$home = getenv('HOME'); | ||
$path = dirname(__FILE__); | ||
$driverFile = 'FrameWordPressValetDriver.php'; | ||
$valetDriverPath = $home . DIRECTORY_SEPARATOR . '.config' . DIRECTORY_SEPARATOR . 'valet' .DIRECTORY_SEPARATOR . 'Drivers'; | ||
$targetDriverFullPath = $path . DIRECTORY_SEPARATOR . $driverFile; | ||
$valetDriverFullPath = $valetDriverPath . DIRECTORY_SEPARATOR . $driverFile; | ||
|
||
if ( file_exists( $valetDriverFullPath ) or is_link( $valetDriverFullPath ) ){ | ||
echo 'Driver already exists, removing' . PHP_EOL; | ||
unlink( $valetDriverFullPath ); | ||
} | ||
|
||
echo 'Creating symlink to driver...' . PHP_EOL; | ||
symlink( $targetDriverFullPath, $valetDriverFullPath ); | ||
$link = readlink( $valetDriverFullPath ) . PHP_EOL; | ||
if ( !$link ){ | ||
echo "Error creating link: readlink() returned " . $link . PHP_EOL; | ||
return 1; | ||
} | ||
|
||
echo "Success! Symbolic link created" . PHP_EOL; | ||
echo $targetDriverFullPath . ' -> ' . $valetDriverFullPath . PHP_EOL; | ||
|
||
echo PHP_EOL . 'Install completed. To update the driver just run "git pull origin master" in this repo'; |