portable

package module
v0.0.0-...-fcab2ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 15 Imported by: 0

README

mkp

auto make symlinks and shortcuts with 'portable.yaml' file for your application on windows

a portable.yaml file looks like this:

bind:
  - '${Roaming}\my_app'
  - '${Document}\my_app'

shortcut:
  - name: My App
    target: '${Roaming}\App\my_app.exe'
    workdir: '${Roaming}\App'
    args: "--hello world"
    category: "My Apps"

you can use the following variables:

  • ${roaming} - roaming directory like: C:\Users\user\AppData\Roaming
  • ${local} - local directory like: C:\Users\user\AppData\Local
  • ${home} - home directory like: C:\Users\user
  • ${programs} - programs directory like: D:\Users\user\AppData\Local\Programs
  • ${document} - document directory like: C:\Users\user\Documents
  • ${desktop} - desktop directory like: C:\Users\user\Desktop
  • ${start} - the start menu directory like: D:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\PortableApps
  • ${base} - the directory where the portable.yaml file is located
  • more variables can find in portable.go

install

> go build -trimpath -ldflags '-s -w' -v github.com/cnk3x/portable/cmd/mkp

> mkp -h
manage portable app

Usage:
  mkp.exe [command]

Available Commands:
  install     install portable app
  list        list portable app
  uninstall   uninstall portable app

Flags:
  -d, --debug     debug output
  -h, --help      help for mkp.exe
  -v, --verbose   verbose output

Use "mkp.exe [command] --help" for more information about a command.

Documentation

Index

Constants

View Source
const CONFIG_FILE_NAME = "portable.yaml"

Variables

This section is empty.

Functions

func FindDirs

func FindDirs(root string, depth int) (dirs []string)

FindDirs finds the directory that contains a portable.yaml file.

Types

type PortableApp

type PortableApp struct {
	Name     string                `json:"name"`
	Bind     []string              `json:"bind"`
	Shortcut []*shortcuts.Shortcut `json:"shortcut"`
	// contains filtered or unexported fields
}

PortableApp struct

func LoadApp

func LoadApp(configPath string) (app *PortableApp, err error)

LoadApp load app config

func (*PortableApp) ConfigPath

func (app *PortableApp) ConfigPath() string

ConfigPath config file path

func (*PortableApp) Install

func (app *PortableApp) Install(force bool) (err error)

Install the app

func (*PortableApp) Uninstall

func (app *PortableApp) Uninstall(force bool) (err error)

Uninstall the app

Directories

Path Synopsis
cmd
flags module
pkg
it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL