mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Ensure script can launch, override path values on logging, add reboot warning
This commit is contained in:
parent
1e658d0735
commit
eda5443bda
@ -129,7 +129,7 @@ export default class SystemPanel {
|
|||||||
}} />
|
}} />
|
||||||
<div className='setting-title'>Add Pulsar to PATH</div>
|
<div className='setting-title'>Add Pulsar to PATH</div>
|
||||||
<div className='setting-description'>
|
<div className='setting-description'>
|
||||||
Add Pulsar to Windows PATH to enable CLI usage.
|
Add Pulsar to Windows PATH to enable CLI usage. (May require a reboot to take effect.)
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,7 +25,7 @@ if (-not $remove) {
|
|||||||
# We want to add Pulsar path values
|
# We want to add Pulsar path values
|
||||||
|
|
||||||
# Lets first save a copy of the users current path
|
# Lets first save a copy of the users current path
|
||||||
$env:Path >> prior2addition.txt;
|
$env:Path > prior2addition.txt;
|
||||||
|
|
||||||
$originalPathToInstall = $installdir
|
$originalPathToInstall = $installdir
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ if (-not $remove) {
|
|||||||
# We want to remove Pulsar from the user path
|
# We want to remove Pulsar from the user path
|
||||||
|
|
||||||
# Lets first save a copy of the users current path
|
# Lets first save a copy of the users current path
|
||||||
$env:Path >> prior2removal.txt;
|
$env:Path > prior2removal.txt;
|
||||||
|
|
||||||
$pulsarPath = $installdir + "\resources";
|
$pulsarPath = $installdir + "\resources";
|
||||||
$ppmPath = $installdir + "\resources\app\ppm\bin";
|
$ppmPath = $installdir + "\resources\app\ppm\bin";
|
||||||
|
@ -118,13 +118,13 @@ class PathOption {
|
|||||||
register(callback) {
|
register(callback) {
|
||||||
this.getPulsarPath().then((pulsarPath) => {
|
this.getPulsarPath().then((pulsarPath) => {
|
||||||
const child = ChildProcess.execFile(
|
const child = ChildProcess.execFile(
|
||||||
`"${pulsarPath}\\resources\\modifyWindowsPath.ps1"`,
|
`powershell.exe '${pulsarPath}\\resources\\modifyWindowsPath.ps1'`,
|
||||||
['-installdir', `"${pulsarPath}"`, '-remove', '0'],
|
['-installdir', `'${pulsarPath}'`, '-remove', '0'],
|
||||||
{ shell: "powershell.exe" },
|
{ shell: "powershell.exe" },
|
||||||
(error, stdout, stderr) =>
|
(error, stdout, stderr) =>
|
||||||
{
|
{
|
||||||
if (error) {
|
if (error) {
|
||||||
atom.notifications.addError(`Error Running Script: ${error.toString()}`);
|
atom.notifications.addError(`Error Running Script: ${error.toString()}`, { dismissable: true });
|
||||||
callback(error);
|
callback(error);
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
@ -140,13 +140,13 @@ class PathOption {
|
|||||||
if (isRegistered) {
|
if (isRegistered) {
|
||||||
this.getPulsarPath().then((pulsarPath) => {
|
this.getPulsarPath().then((pulsarPath) => {
|
||||||
const child = ChildProcess.execFile(
|
const child = ChildProcess.execFile(
|
||||||
`"${pulsarPath}\\resources\\modifyWindowsPath.ps1"`,
|
`powershell.exe "${pulsarPath}\\resources\\modifyWindowsPath.ps1"`,
|
||||||
['-installdir', `"${pulsarPath}"`, '-remove', '1'],
|
['-installdir', `"${pulsarPath}"`, '-remove', '1'],
|
||||||
{ shell: "powershell.exe" },
|
{ shell: "powershell.exe" },
|
||||||
(error, stdout, stderr) =>
|
(error, stdout, stderr) =>
|
||||||
{
|
{
|
||||||
if (error) {
|
if (error) {
|
||||||
atom.notifications.addError(`Error Running Script: ${error.toString()}`);
|
atom.notifications.addError(`Error Running Script: ${error.toString()}`, { dismissable: true });
|
||||||
callback(error);
|
callback(error);
|
||||||
} else {
|
} else {
|
||||||
return callback();
|
return callback();
|
||||||
|
Loading…
Reference in New Issue
Block a user