Skip to content

Dracape/SymP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

SymP (Symlink Populate) is a program written in fish that SymPly SymPlinks files with fewest SymPlinks as possible
Wiki: Purpose

Additional functionality

  • Resolution: Configure symlink resolution
    • Absolute: Point to the absolute path
    • Relative: Point to the relative path
  • Overwrites: Change behavior for performing overwrites
    • Force: Overwrite files without confirmation
    • Interactive: Confirm overwrites interactively
    • Backup: Create a backup before overwriting
  • Blend: Symlinked files inherit access of their new parent directory
    • Permission: DAC permissions
    • Ownership: User & Group ownerships
  • Occurrence: Filter files based on their appearance in the target
    • Common: Present in the target
    • Unique: Absent in the target (avoid overwrites)

Wiki: Switches

Demonstration

The commands

  • ln --symbolic --force --no-target-directory
  • cp --symbolic-link --force --no-target-directory --recursive
  • symp

will be used on the following file-hierarchy (since this program is an balance between the 2 standard utility commands):

  • Source: 📁 original
  • Target: 📁 link
File-hierarchy
📁 original		# Source
├── 📁 common
│	├── 📁 same
│	│	├── 📄 1
│	│	└── 📄 2
│	└── 📁 unique
│		 ├── 📄 same
│		 └── 📄 unique-d
├── 📄 same
├── 📁 uniqued-o
│	└── 📄 sub
└── 📄 uniquef-o

📁 link			# Target
├── 📁 common
│	├── 📁 same
│	│	├── 📄 1
│	│	└── 📄 2
│	└── 📁 unique
│		 ├── 📄 same
│		 └── 📄 unique-l
├── 📄 same
├── 📁 uniqued-l
│	└── 📄 sub
└── 📄 uniquef-l

Results

  1. ln -sfT
    • With 📁 link: ln: Already exists
    • Without 📁 link: 🔗 link → 📁 original
2. cp -sfTr
📁 common
├── 📁 same
│	├── 🔗 1 → 📄 original/common/same/1
│	└── 🔗 2 → 📄 original/common/same/2
└── 📁 unique
	├── 🔗 same → 📄 original/common/unique/same
	├── 🔗 unique-d → 📄 original/common/unique/unique-d
	└── 📄 unique-l
🔗 same → 📄 original/same
📁 uniqued-l
└── 📄 sub
📁 uniqued-o
└── 📄 sub → original/uniqued-o/sub
📄 uniquef-l
📄 uniquef-o → original/uniquef-o
3. symp
📁 common
├── 🔗 same → 📁 original/common/same
└── 📁 unique
	 ├── 🔗 same → 📄 original/common/unique/same
	 ├── 🔗 unique-d → 📄 original/common/unique/unique-d
	 └── 📄 unique-l
🔗 same → 📄 original/same
📁 uniqued-l
└── 📄 sub
🔗 uniqued-o → 📁 original/uniqued-o		# Directory not present in Target
📄 uniquef-l
🔗 uniquef-o → 📄 original/uniquef-o		# File not present in Target

Installation

# curl -fsSL 'https://raw.githubusercontent.com/Dracape/symp/main/install.fish' | fish -NP