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
  • 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
}