Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';
import MainNavigation from './routes/MainNavigation';

Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,28 @@ https://reactnavigation.org/docs/bottom-tab-navigator/
**APIs to use**
https://brottsplatskartan.se/sida/api
https://www.krisinformation.se/om-krisinformation/for-myndigheter-och-andra-aktorer/oppen-data

# Overview

# Shell scripting

## updateDate.sh

To keep track of the last revision date of specific files in the project, I have provided a simple utility script named updateDate.sh.

_Mark Files for Date Tracking:_
In any file you wish to track, add the following comment at the desired location:

`// Last Updated: YYYY-MM-DD`

_Run the Script:_
Whenever you've made changes and are ready to update the revision date, navigate to the project root in your terminal and run:

`./updateDate.sh`

This will automatically update the date in all marked files to the current date.

_Note_
Ensure the updateDate.sh script has execute permissions. If not, you can grant them using:

`chmod +x updateDate.sh`
2 changes: 2 additions & 0 deletions components/EventsComponent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import React, { useEffect, useState } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { getEvents } from '../services/api'; // adjust the path as per your file structure
Expand Down
1 change: 1 addition & 0 deletions components/MainButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Last Updated: 2023-08-15
2 changes: 2 additions & 0 deletions routes/MainNavigation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';

import { NavigationContainer } from '@react-navigation/native';
Expand Down
2 changes: 2 additions & 0 deletions routes/screens/EventsScreen.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';
import { View, Text, StyleSheet, ScrollView } from 'react-native';
import EventsComponent from '../../components/EventsComponent';
Expand Down
2 changes: 2 additions & 0 deletions routes/screens/HomeScreen.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';
import { View,Text,StyleSheet } from 'react-native';

Expand Down
2 changes: 2 additions & 0 deletions routes/screens/LandingScreen.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';
import { View,Text,StyleSheet } from 'react-native';

Expand Down
2 changes: 2 additions & 0 deletions routes/screens/MapScreen.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';
import MapView from 'react-native-maps';
import { View,Text,StyleSheet } from 'react-native';
Expand Down
2 changes: 2 additions & 0 deletions routes/screens/SettingsScreen.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import * as React from 'react';
import { View,Text,StyleSheet } from 'react-native';

Expand Down
2 changes: 2 additions & 0 deletions services/api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Last Updated: 2023-08-15

import axios from 'axios';

const API_URL = 'https://polisen.se/api';
Expand Down
8 changes: 8 additions & 0 deletions updateDate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Get the current date
DATE=$(date +"%Y-%m-%d")

# Update the date in your files
# This searches for files with the comment and excludes node_modules, .expo, and .vscode
find . -type f \( -name "*.js" -or -name "*.jsx" \) -not -path "./node_modules/*" -not -path "./.expo/*" -not -path "./.vscode/*" -exec grep -l "Last Updated:" {} \; | xargs sed -i '' 's/YYYY-MM-DD/'"$DATE"'/g'