Skip to content

Commit

Permalink
build(project): change new folder permissions to 755 (was 777)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Dec 6, 2023
1 parent a03e073 commit dfd17c6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ SRC_TST := $(ROOT)/test
SRC_TSTS := $(shell find $(SRC_TST) -name "*.ttl" | sort)
FLG_TSTS := $(patsubst $(SRC_TST)/%.ttl,$(DST_TEST)/%.tested,$(SRC_TSTS))

# - Permission mode
PERMISSION_MODE := 755

# sed -i support
SED_FLAG=
SHELL_NAME := $(shell uname -s)
Expand Down Expand Up @@ -143,24 +146,24 @@ build-ontology-jsonld: check $(DST) $(OBJ_ONTS_JSONLD) $(BIN_OKP4_JSONLD) ## Bui

$(OBJ_ONTS_TTL): $(DST_ONT)/%.ttl: $(SRC_ONT)/%.ttl
@echo "${COLOR_CYAN}🔨 building${COLOR_RESET} ontology ${COLOR_GREEN}$@${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@cp $< $@
@sed -i ${SED_FLAG} "s/\$$major/$(VERSION_MAJOR)/g" $@

$(OBJ_ONTS_NT): $(DST_ONT)/%.nt: $(DST_ONT)/%.ttl
@echo "${COLOR_CYAN}🔨 building${COLOR_RESET} ontology ${COLOR_GREEN}$@${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@${call RDF_SERIALIZE,turtle,ntriples,$<,$@}
@${call NT_UNIQUIFY,$@}

$(OBJ_ONTS_RDFXML): $(DST_ONT)/%.rdf.xml: $(DST_ONT)/%.ttl
@echo "${COLOR_CYAN}🔨 building${COLOR_RESET} ontology ${COLOR_GREEN}$@${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@${call RDF_SERIALIZE,turtle,rdfxml,$<,$@}

$(OBJ_ONTS_JSONLD): $(DST_ONT)/%.jsonld: $(DST_ONT)/%.ttl
@echo "${COLOR_CYAN}🔨 building${COLOR_RESET} ontology ${COLOR_GREEN}$@${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@${call RDF_SERIALIZE,turtle,jsonld,$<,$@}

$(BIN_OKP4_NT): $(OBJ_ONTS_NT)
Expand Down Expand Up @@ -204,7 +207,7 @@ format-ttl: check cache $(FLG_FMT_TTLS) ## Format all Turtle files

$(FLG_FMT_TTLS): $(DST_FORMAT)/%.formatted: $(SRC_ONT)/%.ttl
@echo "${COLOR_CYAN}📐 formating: ${COLOR_GREEN}$<${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@${call RDF_WRITE,turtle,$<,"$<.formatted"}
@mv -f "$<.formatted" $<
@touch $@
Expand All @@ -218,7 +221,7 @@ lint-ttl: check cache $(FLG_LINT_TTLS) ## Lint all Turtle files

$(FLG_LINT_TTLS): $(DST_LINT)/%.linted: $(SRC_ONT)/%.ttl
@echo "${COLOR_CYAN}🔬 linting: ${COLOR_GREEN}$<${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@docker run --rm \
-v `pwd`:/usr/src/ontology:ro \
-w /usr/src/ontology \
Expand All @@ -234,7 +237,7 @@ test-ontology: check build-ontology-nt $(FLG_TSTS) ## Test the ontology

$(FLG_TSTS): $(DST_TEST)/%.tested: $(SRC_TST)/%.ttl $(wildcard $(DST_ONT)/*.ttl)
@echo "${COLOR_CYAN}🧪 test: ${COLOR_GREEN}$<${COLOR_RESET}"
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@bash -c '\
for target in $(BIN_OKP4_NT); do \
$(call RDF_SHACL,$<,$$target,$@) \
Expand Down Expand Up @@ -299,7 +302,7 @@ cache: $(DST_CACHE)/$(EXEC_OWL_CLI) ## Download all required files to cache

$(DST_CACHE)/$(EXEC_OWL_CLI):
@echo "${COLOR_CYAN}⤵️ downlading ${COLOR_GREEN}$(notdir $@)${COLOR_RESET}"
@mkdir -p -m 777 $(DST_CACHE); \
@mkdir -p -m $(PERMISSION_MODE) $(DST_CACHE); \
cd $(DST_CACHE); \
wget https://github.com/atextor/owl-cli/releases/download/v$(VERSION_OWL_CLI)/$(EXEC_OWL_CLI)

Expand All @@ -316,12 +319,12 @@ $(FLG_CHECK_OK):
echo "${COLOR_CYAN}${COLOR_GREEN}$$cmd${COLOR_RESET} ($$path)"; \
fi \
done
@mkdir -p -m 777 $(@D)
@mkdir -p -m $(PERMISSION_MODE) $(@D)
@touch $(FLG_CHECK_OK)

$(DST):
@echo "${COLOR_CYAN}📂 creating ${COLOR_GREEN}$@${COLOR_RESET}"
@mkdir -p -m 777 $(DST)
@mkdir -p -m $(PERMISSION_MODE) $(DST)

.PHONY: version
version: ## Show the current version
Expand Down

0 comments on commit dfd17c6

Please sign in to comment.