Skip to content

Commit

Permalink
adds system agnostic makefile code
Browse files Browse the repository at this point in the history
  • Loading branch information
Stimm147 committed Dec 4, 2024
1 parent 5e725cf commit f51d8a3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ COMPETITION = "titanic"
FILE = "gender_submission.csv"
MESSAGE = "Submittion of Kaggle Titanic!"

ifeq ($(OS),Windows_NT)
MKDIR := powershell -Command "if (!(Test-Path './data/$(COMPETITION)')) { New-Item -ItemType Directory -Path './data/$(COMPETITION)' }"
RM := del /q
UNZIP := powershell -Command "Expand-Archive -Path"
DEST := -DestinationPath
else
MKDIR := mkdir -p ./data/$(COMPETITION)
RM := rm -f
UNZIP := unzip
DEST := -d
endif

install:
poetry install --no-root

Expand All @@ -20,9 +32,9 @@ check:

kaggle-download:
kaggle competitions download -c $(COMPETITION)
mkdir -p ./data/titanic
unzip temp.zip -d ./data/$(COMPETITION)
rm temp.zip
$(MKDIR)
$(UNZIP) $(COMPETITION).zip $(DEST) ./data/$(COMPETITION)
$(RM) $(COMPETITION).zip

kaggle-submit:
kaggle competitions submit -c $(COMPETITION) -f ./data/$(COMPETITION)/$(FILE) -m $(MESSAGE)

0 comments on commit f51d8a3

Please sign in to comment.