Commit 0ec3e1ff authored by nanahira's avatar nanahira

change path

parent d0f17449
...@@ -18,7 +18,7 @@ generate: ...@@ -18,7 +18,7 @@ generate:
- npm run build - npm run build
- npm start - npm start
- cd output - cd output
- tar zcvf cn-data.tar.gz deck cn.cdb lflist.conf - tar zcvf cn-data.tar.gz deck expansions
- cd .. - cd ..
artifacts: artifacts:
paths: paths:
...@@ -50,6 +50,6 @@ deploy_to_ygopro_server: ...@@ -50,6 +50,6 @@ deploy_to_ygopro_server:
- ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts - ssh-keyscan koishi.momobako.com >> ~/.ssh/known_hosts
- echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa - echo $NANAHIRA_SSH_KEY | base64 --decode > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/* - chmod 600 ~/.ssh/*
- rsync -4cavzP --delete --exclude=cn-data.tar.gz --exclude=deck output/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions - rsync -4cavzP --delete output/expansions/ nanahira@koishi.momobako.com:~/ygopro-cn/expansions
only: only:
- master - master
...@@ -48,13 +48,18 @@ export class DBReader extends Base { ...@@ -48,13 +48,18 @@ export class DBReader extends Base {
} }
} }
private async openOutputDatabase() { private async openOutputDatabase() {
const fullPath = `${this.config.outputPath}/cn.cdb`; const fullPath = `${this.config.outputPath}/expansions/cn.cdb`;
const createDirectoryPath = `${this.config.outputPath}/deck/cn`; const createDirectoryPaths = [
`${this.config.outputPath}/deck/cn`,
`${this.config.outputPath}/expansions`
];
for (let createDirectoryPath of createDirectoryPaths) {
try { try {
await fs.access(createDirectoryPath); await fs.access(createDirectoryPath);
} catch (e) { } catch (e) {
this.log.debug(`Creating directory ${createDirectoryPath} ...`); this.log.debug(`Creating directory ${createDirectoryPath} ...`);
await fs.mkdir(createDirectoryPath, { recursive: true }); await fs.mkdir(createDirectoryPath, { recursive: true });
}
} }
try { try {
await fs.unlink(fullPath); await fs.unlink(fullPath);
...@@ -145,7 +150,7 @@ export class DBReader extends Base { ...@@ -145,7 +150,7 @@ export class DBReader extends Base {
] ]
} }
]); ]);
await fs.writeFile(`${this.config.outputPath}/lflist.conf`, banlistString); await fs.writeFile(`${this.config.outputPath}/expansions/lflist.conf`, banlistString);
} }
private async checkExtraDeckCards(code: number) { private async checkExtraDeckCards(code: number) {
const sql = `select id from datas where type & (0x4000000 | 0x800000 | 0x2000 | 0x40) > 0 AND id = ?`; const sql = `select id from datas where type & (0x4000000 | 0x800000 | 0x2000 | 0x40) > 0 AND id = ?`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment