Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ slack-archive
.DS_Store
*.log
.token
lib
lib
.env
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ npx slack-archive
--channel-types Comma-separated list of channel types to fetch messages from.
(public_channel, private_channel, mpim, im)
--exclude-channels Comma-separated list of channels to exclude, in automatic mode
--output Specify custom output directory (default: ./slack-archive)
--no-backup: Don't create backups. Not recommended.
--no-search: Don't create a search file, saving disk space.
--no-file-download: Don't download files.
Expand All @@ -53,7 +54,7 @@ This will be mostly painless, I promise.
Head over to https://api.slack.com/apps and `Create New App`. Select `From scratch`.
Give it a name and choose the workspace you'd like to export.

Then, from the `Features` menu on the left, select `OAuth & Permission`.
Then, from the `Features` menu on the left, select `OAuth & Permission`.

As a redirect URL, enter something random that doesn't actually exist, or a domain you control. For instace:

Expand Down Expand Up @@ -100,9 +101,9 @@ https://notarealurl.com/?code={code}&state=
Copy everything between `?code=` and `&state`. This is your `code`. We'll need it in the
next step.

Next, we'll exchange your code for a token. To do so, we'll also need your `client secret`
from the first step when we created your app. In a browser, open this URL - replacing
`{your-team-name}`, `{your-client-id}`, `{your-code}` and `{your-client-secret}` with
Next, we'll exchange your code for a token. To do so, we'll also need your `client secret`
from the first step when we created your app. In a browser, open this URL - replacing
`{your-team-name}`, `{your-client-id}`, `{your-code}` and `{your-client-secret}` with
your values.

```
Expand Down
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ async function getAuthTest() {

export async function main() {
console.log(`Welcome to slack-archive${getLastSuccessfulRun()}`);
console.log(`Output will be saved to: ${OUT_DIR}`);

if (AUTOMATIC_MODE) {
console.log(`Running in fully automatic mode without prompts`);
Expand Down
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ export const FORCE_HTML_GENERATION = findCliParameter(
"--force-html-generation"
);
export const EXCLUDE_CHANNELS = getCliParameter("--exclude-channels");
export const OUTPUT_DIR = getCliParameter("--output");
export const BASE_DIR = process.cwd();
export const OUT_DIR = path.join(BASE_DIR, "slack-archive");
export const OUT_DIR = OUTPUT_DIR ? path.resolve(OUTPUT_DIR) : path.join(BASE_DIR, "slack-archive");
export const TOKEN_FILE = path.join(OUT_DIR, ".token");
export const DATE_FILE = path.join(OUT_DIR, ".last-successful-run");
export const DATA_DIR = path.join(OUT_DIR, "data");
Expand Down