Skip to content

Commit

Permalink
fix(core): use target_os = "linux" instead of just linux for watc…
Browse files Browse the repository at this point in the history
…h events
  • Loading branch information
Cammisuli committed Dec 1, 2023
1 parent 5a47eaf commit 05fb0d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion e2e/nx-misc/src/watch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ import {
getStrippedEnvironmentVariables,
updateJson,
isVerboseE2ERun,
readFile,
} from '@nx/e2e/utils';
import { spawn } from 'child_process';
import { join } from 'path';
import { writeFileSync } from 'fs';
import { writeFileSync, mkdtempSync } from 'fs';
import { tmpdir } from 'os';

let cacheDirectory = mkdtempSync(join(tmpdir(), 'daemon'));
console.log('cache directory', cacheDirectory);

async function writeFileForWatcher(path: string, content: string) {
const e2ePath = join(tmpProjPath(), path);
Expand All @@ -33,11 +38,17 @@ describe('Nx Watch', () => {
env: {
NX_DAEMON: 'true',
NX_NATIVE_LOGGING: 'nx',
NX_PROJECT_GRAPH_CACHE_DIRECTORY: cacheDirectory,
},
});
});

afterEach(() => {
if (process.env.NX_E2E_OUTPUT_DAEMON_LOGS === 'true') {
let daemonLog = readFile(join(cacheDirectory, 'd/daemon.log'));
const testName = expect.getState().currentTestName;
console.log(`${testName} daemon log: \n${daemonLog}`);
}
runCLI('reset');
});

Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/native/watch/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub(super) fn get_nx_ignore<P: AsRef<Path>>(origin: P) -> Option<IgnoreFile> {
}

pub(super) fn transform_event(watch_event: &Event) -> Option<Event> {
if cfg!(linux) {
if cfg!(target_os = "linux") {
let tags = watch_event
.tags
.clone()
Expand Down

0 comments on commit 05fb0d0

Please sign in to comment.