Skip to content

Commit

Permalink
🚨 [Fix] file 경로 테스트 로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
김혜진 authored and 김혜진 committed Sep 20, 2024
1 parent ea89ce2 commit 90372ff
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

import java.nio.file.Paths;
import java.util.List;
import java.util.ArrayList;
import java.io.*;
Expand Down Expand Up @@ -59,9 +61,9 @@ public ResponseEntity<CustomApiResponse<?>> createReport(Long repoId) {

// 깃허브 레포트 생성 (Node.js 스크립트실행)
// local
// ProcessBuilder processBuilder = new ProcessBuilder("ts-node", "src/main/resources/scripts/3d-contrib/src/index.ts");
ProcessBuilder processBuilder = new ProcessBuilder("ts-node", "src/main/resources/scripts/3d-contrib/src/index.ts");
// deploy
ProcessBuilder processBuilder = new ProcessBuilder("ts-node", "../../src/main/resources/scripts/3d-contrib/src/index.ts");
// ProcessBuilder processBuilder = new ProcessBuilder("ts-node", "../../src/main/resources/scripts/3d-contrib/src/index.ts");

// 환경 변수 설정
processBuilder.environment().put("GITHUB_DATA", response);
Expand Down Expand Up @@ -92,7 +94,7 @@ public ResponseEntity<CustomApiResponse<?>> createReport(Long repoId) {
System.out.println("Node.js script finished with exit code: " + exitCode);

if (exitCode != 0) {
throw new RuntimeException("3D 그래프 생성 중 오류 발생, exit code: " + exitCode);
throw new RuntimeException("레포트 생성 중 오류 발생, exit code: " + exitCode);
}

String[] imageUrl = new String[7]; // 배포 이미지 url
Expand All @@ -107,7 +109,7 @@ public ResponseEntity<CustomApiResponse<?>> createReport(Long repoId) {
}

// 경로확인(테스트)
// System.out.println("Current working directory: " + Paths.get("").toAbsolutePath().toString());
System.out.println("Current working directory: " + Paths.get("").toAbsolutePath().toString());

// file 가져오기
// local
Expand All @@ -120,7 +122,7 @@ public ResponseEntity<CustomApiResponse<?>> createReport(Long repoId) {

// 해당 file 지우기
if (file.delete()) {
System.out.println("file 삭제 성공 : " + file.getPath());
System.out.println("file 삭제 성공 : " + file.getPath());
} else {
System.out.println("file 삭제 실패 : " + file.getPath());
}
Expand Down

0 comments on commit 90372ff

Please sign in to comment.