From fee66ad87d934d385b19e152d91dd6d418db5bba Mon Sep 17 00:00:00 2001 From: xueye Date: Sat, 22 Jan 2022 23:40:22 +0800 Subject: [PATCH] fix: Update Intellij persist script --- scripts/jetbrains/portable.ps1 | 2643 +------------------------------- 1 file changed, 29 insertions(+), 2614 deletions(-) diff --git a/scripts/jetbrains/portable.ps1 b/scripts/jetbrains/portable.ps1 index eec12e9..0d0577b 100644 --- a/scripts/jetbrains/portable.ps1 +++ b/scripts/jetbrains/portable.ps1 @@ -1,2614 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Scoop-JetBrains/portable.ps1 at main · Ash258/Scoop-JetBrains - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - - -
- -
- - - - - - - -
- - - -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - Ash258  /   - Scoop-JetBrains  /   - -
- - - - Type # for issues and pull requests, > for commands, and ? for help - - - Type # for issues, pull requests, and projects, > for commands, and ? for help - - - Type # for issues, pull requests, and projects, / for files, and > for commands - - -
- -
-
- We’ve encountered an error and some results aren't available at this time. Type a new search or try again later. -
-
- - No results matched your search - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - Search for issues and pull requests - - # - - - - Search for issues, pull requests, discussions, and projects - - # - - - - Search for organizations, repositories, and users - - @ - - - - Search for projects - - ! - - - - Search for files - - / - - - - Activate command mode - - > - - - - Search your issues, pull requests, and discussions - - # author:@me - - - - Search your issues, pull requests, and discussions - - # author:@me - - - - Filter to pull requests - - # is:pr - - - - Filter to issues - - # is:issue - - - - Filter to discussions - - # is:discussion - - - - Filter to projects - - # is:project - - - - Filter to open issues, pull requests, and discussions - - # is:open - - - - - - - - - - - - - - - - -
-
-
- -
- - - - - - - - - - -
- - - - -
-
-
- - - - - - - - - -
- -
- -
-

- - - / - - Scoop-JetBrains - - - Public -

- -
- -
    - - - -
  • - -
    - - - - - - - Watch - - - 7 - - - -
    -
    -

    Notifications

    - -
    - -
    -
    - - - - - - - - -
    - - -
    - - - - - Get push notifications on iOS or Android. - -
    -
    -
    -
    - - -
    -
    -
    - - - -
  • - -
  • -
    -
    -
  • - -
  • - -
    -
    - -
    -
    - -
    -
    - - - - - -
    - -
    -
    - - - - - - - -
    - -
    -
    -
    -
    -
    -
  • - -
  • - - -
  • -
- -
- -
-
- - - - -
- - - -
-
- - Open in github.dev - Open in a new github.dev tab - - - - - - - -
- - - - - Permalink - - -
- -
-
- - - main - - - - -
-
-
- Switch branches/tags - -
- - - -
- -
- -
- - -
- -
- - - - - - - - - - - - - - - - -
- - -
-
-
-
- -
- -
- - - - Go to file - - -
- - - - -
-
-
- - - - -
- -
-
-
 
-
- -
-
 
- Cannot retrieve contributors at this time -
-
- - - - - - - - - - - -
- -
- - -
- - - 29 lines (24 sloc) - - 1.13 KB -
- -
- - - - -
- - - - - - - - - - - - - - - -
- -
-
- -
-
- -
- -
-
- - - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<#
.SYNOPSIS
Universal portable mode enabler
IDE subdirectory is needed.
.PARAMETER Directory
Current '$dir' of application
.PARAMETER Persist
Persist directory of application
#>
param([Parameter(Mandatory)][String] $Directory, [Parameter(Mandatory)][String] $Persist)
-
$properties = Join-Path 'IDE' 'bin\idea.properties'
-
if (!(Join-Path $Persist $properties | Test-Path)) {
Write-Host "File $properties does not exists. Creating." -ForegroundColor 'Yellow'
-
$fullProp = Join-Path $Directory $properties
$currentForward = (Split-Path $Directory | Join-Path -ChildPath 'current') -replace '\\', '/'
$profileDir = "$currentForward/profile"
-
$CONT = Get-Content $fullProp
# Set portable configuration
$CONT = $CONT -replace '^#\s*(idea.config.path=).*$', "`$1$profileDir/config"
$CONT = $CONT -replace '^#\s*(idea.system.path=).*$', "`$1$profileDir/system"
$CONT = $CONT -replace '^#\s*(idea.plugins.path=).*$', '$1${idea.config.path}/plugins'
$CONT = $CONT -replace '^#\s*(idea.log.path=).*$', '$1${idea.system.path}/log'
-
Set-Content -LiteralPath $fullProp -Value $CONT -Encoding 'Ascii' -Force
}
-
- - - -
- -
- - - - -
- - -
- - -
-
- - -
- - - -
-
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - - +<# +.SYNOPSIS + Universal portable mode enabler + IDE subdirectory is needed. +.PARAMETER Directory + Current '$dir' of application +.PARAMETER Persist + Persist directory of application +#> +param([Parameter(Mandatory)][String] $Directory, [Parameter(Mandatory)][String] $Persist) + +$properties = Join-Path 'IDE' 'bin\idea.properties' + +if (!(Join-Path $Persist $properties | Test-Path)) { + Write-Host "File $properties does not exists. Creating." -ForegroundColor 'Yellow' + + $fullProp = Join-Path $Directory $properties + $currentForward = (Split-Path $Directory | Join-Path -ChildPath 'current') -replace '\\', '/' + $profileDir = "$currentForward/profile" + + $CONT = Get-Content $fullProp + # Set portable configuration + $CONT = $CONT -replace '^#\s*(idea.config.path=).*$', "`$1$profileDir/config" + $CONT = $CONT -replace '^#\s*(idea.system.path=).*$', "`$1$profileDir/system" + $CONT = $CONT -replace '^#\s*(idea.plugins.path=).*$', '$1${idea.config.path}/plugins' + $CONT = $CONT -replace '^#\s*(idea.log.path=).*$', '$1${idea.system.path}/log' + + Set-Content -LiteralPath $fullProp -Value $CONT -Encoding 'Ascii' -Force +}