Skip to content

Commit

Permalink
fix: init generator
Browse files Browse the repository at this point in the history
  • Loading branch information
David Garcia committed Jul 10, 2023
1 parent 274f7dd commit 33a997d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion generators.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.1",
"generators": {
"init": {
"factory": "./src/generators/init/generator",
"factory": "./lib/generators/init/generator",
"schema": "./src/generators/init/schema.json",
"description": "Initialize nx-gcp-cache plugin"
}
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nx-gcp-cache",
"version": "1.0.0-beta",
"version": "1.0.0",
"description": "GCP Cloud Storage Cache plugin for Nx",
"keywords": [
"GCP",
Expand All @@ -16,9 +16,9 @@
],
"license": "MIT",
"author": "David Garcia",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"typings": "lib/index.d.ts",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"typings": "./lib/index.d.ts",
"generators": "./generators.json",
"repository": {
"type": "git",
Expand Down Expand Up @@ -71,6 +71,9 @@
"typescript": "5.0.4"
},
"files": [
"src/generators/init/schema.json",
"lib/",
"generators.json"

]
}
5 changes: 0 additions & 5 deletions src/tasks-runner/gcp-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@ export class GcpCache implements RemoteCache {
private messages: MessageReporter,
) {
const gcpBucket = options.gcpBucket ?? '';
console.log(`gcpBucket: ${gcpBucket}`);
const bucketTokens = gcpBucket.split('/');
this.bucket = bucketTokens.shift() as string;
console.log(`bucket: ${this.bucket}`);
this.path = bucketTokens.join('/');
console.log(`path: ${this.path}`);
this.logger.warn(`bucket: ${this.bucket}`);
this.gcsClient = new Storage().bucket(this.bucket, {});
// const options: StorageOptions = {};
}

public checkConfig(options: GcpNxCacheOptions): void {
Expand Down
4 changes: 2 additions & 2 deletions src/tasks-runner/runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
dotEnvConfig();

import { defaultTasksRunner } from '@nx/devkit';
import { TaskStatus } from '@nx/workspace/src/tasks-runner/tasks-runner';
import { config as dotEnvConfig } from 'dotenv';
Expand All @@ -9,6 +7,8 @@ import { Logger } from './logger';
import { MessageReporter } from './message-reporter';
import { GcpNxCacheOptions } from './models/gcp-nx-cache-options.model';

dotEnvConfig();

function getOptions(options: GcpNxCacheOptions) {
return {
gcpBucket: process.env.NXCACHE_GCP_BUCKET ?? options.gcpBucket,
Expand Down

0 comments on commit 33a997d

Please sign in to comment.