From 14da6b347252a1a6780ced147f4234c303a36d4e Mon Sep 17 00:00:00 2001 From: yutounun Date: Fri, 29 Sep 2023 09:13:36 +0900 Subject: [PATCH] fix leetcode.js to accept mutiple solutions --- scripts/leetcode.js | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/scripts/leetcode.js b/scripts/leetcode.js index a4569f25..95494dcb 100644 --- a/scripts/leetcode.js +++ b/scripts/leetcode.js @@ -219,31 +219,19 @@ function uploadGit( ) { sha = stats.sha[filePath]; } + const uniqueFileName = `${fileName}-${Math.random()}`; - if (action === 'upload') { - /* Upload to git. */ - upload( - token, - hook, - code, - problemName, - fileName, - sha, - msg, - cb, - ); - } else if (action === 'update') { - /* Update on git */ - update( - token, - hook, - code, - problemName, - msg, - prepend, - cb, - ); - } + /* Upload to git. */ + upload( + token, + hook, + code, + problemName, + uniqueFileName, + sha, + msg, + cb, + ); }); } });