-
-
Notifications
You must be signed in to change notification settings - Fork 60
Add CLI support #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
An-GG
wants to merge
6
commits into
robrohan:master
Choose a base branch
from
An-GG:webarchiveextractor-for-rob
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add CLI support #12
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6b68920
move extraction logic out of DropView to Extractor
An-GG 23413bc
allow using raw executable with command line args
An-GG 0822297
required build settings change to code sign successfully
An-GG e214744
README
An-GG 1427a9f
Xcode command line build instructions update
An-GG c5e48f6
Merge branch 'master' into webarchiveextractor-for-rob
An-GG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,64 @@ | ||
# WebArchiveExtractor | ||
|
||
## Building Help | ||
Mac OS X utility to un-archive .webarchive files (like when saving from Safari) | ||
|
||
``` | ||
cd WebArchiveExtractorHelp | ||
``` | ||
This project was forked from [Vitaly Davidenko's repo on sourceforge](https://sourceforge.net/projects/webarchivext/). | ||
|
||
``` | ||
hiutil -I corespotlight -Caf WebArchiveExtractorHelp.cshelpindex -vv . | ||
``` | ||
## Usage | ||
|
||
``` | ||
hiutil -I lsm -Caf WebArchiveExtractorHelp.helpindex -vv . | ||
``` | ||
You can use the utility graphically by launching WebArchiveExtractor.app directly. [See interface here.](https://robrohan.github.io/WebArchiveExtractor/) | ||
|
||
Verify: | ||
``` | ||
hiutil -I corespotlight -Tvf WebArchiveExtractorHelp.cshelpindex | ||
``` | ||
You can also run the same executable from from the command line: | ||
|
||
```sht | ||
./WebArchiveExtractor.app/Contents/MacOS/WebArchiveExtractor | ||
``` | ||
mv WebArchiveExtractorHelp WebArchiveExtractorHelp.help | ||
``` | ||
|
||
--- | ||
Running with no arguments will just launch the GUI. | ||
|
||
NOTE: this file is from the original sourceforge code. There is no Automator code in this forked version | ||
> An ancestor of this project supported Automator Actions at one point. This project does not have this functionality. Use the CLI for programmatic access. | ||
|
||
Release notes | ||
**CLI Usage** | ||
|
||
Version 0.1 - initial release | ||
This release contains two independent parts | ||
--- | ||
|
||
Part 1. Application 'Web Archive Extractor' | ||
|
||
files: | ||
WebArchiveExtractor.zip contains Application | ||
Extract contents of `website.webarchive` to a directory named `website` relative to CWD: | ||
```sh | ||
WebArchiveExtractor website.webarchive | ||
``` | ||
```sh | ||
WebArchiveExtractor -i website.webarchive | ||
``` | ||
|
||
To install 'Web Archive Extractor' | ||
- unpack WebArchiveExtractor.zip | ||
- copy WebArchiveExtractor into /Application folder | ||
--- | ||
|
||
Define explicit output directory: | ||
```sh | ||
WebArchiveExtractor website.webarchive -o out | ||
``` | ||
|
||
Part 2. Automator Action | ||
## Build | ||
You *should* be able to automatically build and sign a release for local execution by running this command in the root of the project, even if you are not an Apple developer (assuming you've got the Xcode CLI tools): | ||
|
||
files: | ||
Automator-WebArchiveExtractorAction.action.zip contains Automator Plugin | ||
Automator-ExtractWebarchive.zip contains sample workflow | ||
> Update: You need to do two things first:<br><br> | ||
> - Step 1. Download Xcode from the App Store (**Note: You don't have to run it, if you do it'll use up a bunch of disk space**)<br> | ||
> - Step 2. Run `xcodebuild -runFirstLaunch` in the Terminal | ||
|
||
To install Automator Action | ||
- unpack zip | ||
- copy WebArchiveExtractorAction.action into /Users/<your username>/Library/Automator folder | ||
```sh | ||
xcodebuild -project WebArchiveExtractor.xcodeproj | ||
``` | ||
If the command fails, you'll need to open the project in Xcode to investigate. | ||
|
||
|
||
Version 0.2 | ||
Version 0.2 improves stability and addresses a number of other minor issues. | ||
-crash on releasing of autorelease pool fixed (in NSCoreDragReceiveProc) | ||
-main resource name changed to webarchive-index.html | ||
-bundle identifiers changed | ||
The resulting `WebArchiveExtractor.app` should be in `build/Release`. To install, you can just drag it to your Applications directory. | ||
|
||
files: | ||
WebArchiveExtractor.0.2.zip contains Application | ||
Automator-WebArchiveExtractorAction.0.2.action.zip contains Automator Plugin | ||
> Keep in mind that the executable is inside the `.app` bundle. To reference the command in your shell, you can do something like either of the following: | ||
|
||
. | ||
Add to PATH: | ||
```sh | ||
# Add this to your shell's rc file: | ||
export PATH="$PATH:/Applications/WebArchiveExtractor.app/Contents/MacOS/" | ||
``` | ||
Symlink to a location already in PATH: | ||
```sh | ||
ln -s /Applications/WebArchiveExtractor.app/Contents/MacOS/WebArchiveExtractor ~/.local/bin/WebArchiveExtractor | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove these
printfs
. I believe these are here to show output when running from the command line version - they might be better to just be in the logMessage function and not do the colours as we're assuming the colour scheme of the terminal.