Skip to content
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

Create data directory to improve k8s convenience #123

Merged
merged 4 commits into from
Sep 6, 2021
Merged
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /app
COPY . /app
COPY --from=builder /app/node_modules ./node_modules
# Create empty history.json, disable loop in container
RUN echo "{}" > history.json \
&& sed -i 's/"loop": true/"loop": false/g' config.json
RUN echo "{}" > data/history.json \
&& sed -i 's/"loop": true/"loop": false/g' data/config.json

CMD ["npm", "start", "--no-update-notifier"]
8 changes: 4 additions & 4 deletions claimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const { "Launcher": EpicGames } = require("epicgames-client");
const { freeGamesPromotions } = require("./src/gamePromotions");
const { writeFile } = require("fs");

const Auths = require(`${__dirname}/device_auths.json`);
const Auths = require(`${__dirname}/data/device_auths.json`);
const CheckUpdate = require("check-update-github");
const Config = require(`${__dirname}/config.json`);
const History = require(`${__dirname}/history.json`);
const Config = require(`${__dirname}/data/config.json`);
const History = require(`${__dirname}/data/history.json`);
const Logger = require("tracer").console(`${__dirname}/logger.js`);
const Package = require("./package.json");

Expand Down Expand Up @@ -104,7 +104,7 @@ function sleep(delay) {
Logger.info(`Logged ${client.account.name} out of Epic Games`);
}

await write(`${__dirname}/history.json`, JSON.stringify(History, null, 4));
await write(`${__dirname}/data/history.json`, JSON.stringify(History, null, 4));
if (loop) {
Logger.info(`Waiting ${delay} minutes`);
await sleep(delay);
Expand Down
File renamed without changes.
File renamed without changes.