From c5e24c54e5578229f13a98318529b07a0f58f190 Mon Sep 17 00:00:00 2001 From: Cretu Eusebiu Date: Fri, 30 Dec 2016 22:07:33 +0200 Subject: [PATCH] Fix share command --- cli/includes/helpers.php | 4 ++++ cli/valet.php | 5 +++- valet | 52 +++++----------------------------------- 3 files changed, 14 insertions(+), 47 deletions(-) diff --git a/cli/includes/helpers.php b/cli/includes/helpers.php index ca10b3f43..8d3202395 100644 --- a/cli/includes/helpers.php +++ b/cli/includes/helpers.php @@ -3,6 +3,10 @@ use Illuminate\Container\Container; use Symfony\Component\Process\Process; +if (!isset($_SERVER['HOME'])) { + $_SERVER['HOME'] = $_SERVER['USERPROFILE']; +} + /** * Define the ~/.valet path as a constant. */ diff --git a/cli/valet.php b/cli/valet.php index f6955f383..b6ed381fb 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -187,7 +187,10 @@ * Generate a publicly accessible URL for your project. */ $app->command('share', function () { - warning("It looks like you are running `cli/valet.php` directly, please use the `valet` script in the project root instead."); + $host = basename(getcwd()); + $domain = Configuration::read()['domain']; + + passthru("start ".__DIR__."/../bin/ngrok http $host.$domain:80 -host-header=rewrite"); })->descriptions('Generate a publicly accessible URL for your project'); /** diff --git a/valet b/valet index a6f8ec4ee..dfe0c0bc0 100755 --- a/valet +++ b/valet @@ -1,48 +1,8 @@ -#!/usr/bin/env bash +#!/usr/bin/env php +