Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ezefranca committed Jul 4, 2024
2 parents fe672be + a3eb406 commit 415fbf4
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# check-permissions [![Swift](https://github.com/ezefranca/check-permissions/actions/workflows/swift.yml/badge.svg)](https://github.com/ezefranca/check-permissions/actions/workflows/swift.yml)

## Overview
Expand All @@ -15,14 +14,14 @@ The **Check Permissions** CLI tool is a Swift-based command line application des

### Prerequisites

- macOS 11.0 or later
- macOS 12.0 or later
- Swift 5.3 or later

### Steps

1. **Clone the Repository**:
```sh
git clone <repository-url>
git clone https://github.com/ezefranca/check-permissions.git
cd check-permissions
```

Expand All @@ -32,7 +31,7 @@ The **Check Permissions** CLI tool is a Swift-based command line application des
./install.sh
```

The installation script will compile the tool and install it to `/usr/local/bin`, making it available globally as `check-permissions`.
The installation script will compile the tool and install it to `/usr/local/bin`, making it available globally as `check-permissions-cli`.

## Usage

Expand All @@ -46,13 +45,13 @@ The installation script will compile the tool and install it to `/usr/local/bin`
To scan a `Pods` directory for `Info.plist` files and report the permissions:

```sh
check-permissions --path /Users/yourusername/Developer/YourProject/Pods
check-permissions-cli --path /Users/yourusername/Developer/YourProject/Pods
```

To display the help message:

```sh
check-permissions --help
check-permissions-cli --help
```

### Sample Output
Expand All @@ -68,6 +67,49 @@ File: /Users/yourusername/Developer/YourProject/Pods/ModuleB/Info.plist
No permissions found in any Info.plist files.
```

## Using as a Package

To use the **Check Permissions** package in your Swift project, add it as a dependency in your `Package.swift`:

```swift
// swift-tools-version:5.4
import PackageDescription
let package = Package(
name: "YourProject",
platforms: [
.iOS(.v15),
.macOS(.v12),
.watchOS(.v9),
.tvOS(.v15),
.visionOS(.v1)
],
dependencies: [
.package(url: "https://github.com/ezefranca/check-permissions", from: "0.0.2"),
],
targets: [
.target(
name: "YourProject",
dependencies: ["check-permissions"]),
]
)
```

Then import and use it in your code:

```swift
import check_permissions
let checker = PermissionChecker()
let report = checker.generateReport(for: URL(fileURLWithPath: "/path/to/Pods"))
for (plistPath, permissions) in report {
print("File: \(plistPath)")
for permission in permissions {
print(" - \(permission)")
}
}
```
## Contributing
We welcome contributions to enhance the functionality of this tool. Please follow these steps to contribute:
Expand Down

0 comments on commit 415fbf4

Please sign in to comment.